Ruby RabbitMQ clients blog

News and updates about various Ruby clients for RabbitMQ

Hutch 0.20.0 Is Released

TL;DR

Hutch 0.20.0 is released to rubygems.org.

This is a minor feature release.

Changes between 0.19.0 and 0.20.0

Hutch::Exception includes Bunny::Exception

Hutch::Exception now inherits from Bunny::Exception which inherits from StandardError.

GH issue: #137.

Pluggable (Negative) Acknowledge Handlers

Hutch now can be configured to use a user-provided object(s) to perform acknowledgement on consumer exceptions.

For example, this is what the default handler looks like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'hutch/logging'
require 'hutch/acknowledgements/base'

module Hutch
  module Acknowledgements
    class NackOnAllFailures < Base
      include Logging

      def handle(delivery_info, properties, broker, ex)
        prefix = "message(#{properties.message_id || '-'}): "
        logger.debug "#{prefix} nacking message"

        broker.nack(delivery_info.delivery_tag)

        # terminates further chain processing
        true
      end
    end
  end
end

Handlers are configured similarly to exception notification handlers, via :error_acknowledgements in Hutch config.

Contributed by Derek Kastner.

GH issue: #177.

Configurable Exchange Properties

:mq_exchange_options is a new config option that can be used to provide a hash of exchange attributes (durable, auto-delete). The options will be passed directly to Bunny (or March Hare, when running on JRuby).

Contributed by Derek Kastner.

GH issue: #170.

Bunny Update

Bunny is updated to 2.2.1.

Full Changelog

Full change log can be found on GitHub.

About the Author

Michael on behalf of the Hutch maintainers Team.