Hutch now allows ActiveSupport 7.x.
Contributed by @ivanhuang1.
GitHub issue: #362
Contributed by Karol @Azdaroth Galanciak.
GitHub issue: #360
Contributed by Karol @Azdaroth Galanciak.
GitHub issue: #363
Values set with Hutch::Config.set
now have expected setting type casting
applied to them.
Contributed by Karol @Azdaroth Galanciak.
GitHub issue: #358
Contributed by Ulysse @BuonOmo Buonomo.
GitHub issue: #356
Contributed by Johan @johankok Kok.
GitHub issue: #353
Hutch has been around for several years. It is time to ship a 1.0. With it we try to correct a few of overly opinionated decisions from recent releases. This means this release contains potentially breaking changes.
-
Hutch will no longer configure any queue type (such as quorum queues) or queue mode (used by classic lazy queues) by default as that can be breaking change for existing Hutch and RabbitMQ installations due to the property equivalence requirement in AMQP 0-9-1.
This means some defaults introduced in
0.28.0
(gocardless/hutch#341) were reverted. The user has to opt in to configure the queue type and mode and other optional arguments they need to use. Most optional arguments can be set via policies which is always the recommended approach. Queue type, unfortunately, is not one of them as different queue types have completely different implementation details, on disk data formats and so on.To use a quorum queue, use the
quorum_queue
consumer DSL method:class ConsumerUsingQuorumQueue include Hutch::Consumer consume 'hutch.test1' # when in doubt, prefer using a policy to this DSL # https://www.rabbitmq.com/parameters.html#policies arguments 'x-key': :value quorum_queue end
To use a classic lazy queue, use the
lazy_queue
consumer DSL method:class ConsumerUsingLazyQueue include Hutch::Consumer consume 'hutch.test1' # when in doubt, prefer using a policy to this DSL # https://www.rabbitmq.com/parameters.html#policies arguments 'x-key': :value lazy_queue classic_queue end
By default Hutch will not configure any
x-queue-type
orx-queue-mode
optional arguments which is identical to RabbitMQ defaults (a regular classic queue).Note that as of RabbitMQ 3.8.2, an omitted
x-queue-type
is considered to be identical tox-queue-type
set toclassic
by RabbitMQ server.-
Exchange type is now configurable via the
mq_exchange_type
config setting. Supported exchanges must be compatible with topic exchanges (e.g. wrap it). Default value istopic
.This feature is limited to topic and delayed message exchange plugins and is mostly useful for forward compatibility.
Contributed by Michael Bumann.
GitHub issue: gocardless/hutch#349
-
-
Add lazy and quorum options for queues.
GitHub issue: gocardless/hutch#341
Contributed by: Arthur Del Esposte
-
Log level in the message publisher switched to DEBUG.
GitHub issue: gocardless/hutch#343
Contributed by: Codruț Constantin Gușoi
-
Add zeitwerk note to README.
GitHub issue: gocardless/hutch#342
Contributed by: Paolo Zaccagnini
-
Use jruby-9.2.9.0
GitHub issue: gocardless/hutch#336
Contributed by: Olle Jonsson
-
Error handler for Rollback.
GitHub issue: gocardless/hutch#332
Contributed by Johan Kok.
-
Allow for the latest ActiveSupport version.
GitHub issue: gocardless/hutch#334
-
Signal tests are now skipped on JRuby.
Contributed by Olle Jonsson.
GitHub issue: gocardless/hutch#326
Bunny and other dependencies were updated to their latest release series.
Bunny and other dependencies were updated to their latest release series.
The methods that connect to RabbitMQ are now synchronized which makes them safer to use in concurrent settings. Note that Hutch still uses a single Bunny channel which is not meant to be shared between threads without application-level synchronization for publishing.
Contributed by Chris Barton.
GitHub issue: #308.
Contributed by Damian Le Nouaille.
GitHub issue: #322.
The service is no longer generally available.
Contributed by Olle Jonsson.
GitHub issue: #313
Consumer groups allow you to run groups of consumers together, rather than running them
all at once in a single process. You define groups in your config file, and then specify
a --only-group
option when starting up Hutch with hutch
.
Contributed by Nickolai Smirnov.
GitHub pull request: #296
When Hutch is configured to connect to RabbitMQ with a URI, we should respect the
amqps
specification, defaulting to the standard protocol ports when not specified.
This means, for example, that amqp://guest:[email protected]/
connects to the server on
port 5672 and does not use TLS, whereas amqps://guest:[email protected]/
connects to the
server on port 5671 and uses TLS.
This behaviour was introduced in #159 but broken since then. This fixes it, and includes tests.
Contributed by Michael Canden-Lennox.
GitHub pull request: #305
When an error occurs during Hutch's startup, it is currently not passed to the configured error handlers. This starts handling those exceptions.
Contributed by Valentin Krasontovitsch.
GitHub issue: #288 GitHub pull request: #301
When starting up Hutch in verbose mode with hutch -v
, the Rails environment is now
logged.
Contributed by @wppurking.
GitHub pull request: #282
honeybadger-ruby
changed
its API in v3.0.0. This updates our error handler to work with that, whilst still
maintaining our existing behaviour.
Contributed by Olle Jonsson and Bill Ruddock.
GitHub pull requests: #274, #290
Hutch consumers now can use user-provided prefixes for consumer tags.
Contributed by Dávid Lantos.
GitHub issue: #265
Hutch will now handle several OS signals:
USR2
will log stack traces of all alive VM threadsQUIT
(except on JRuby),INT
,TERM
will cause Hutch daemon to shut down
Contributed by Olle Jonsson.
Hutch now provides a tracer implementation for Opbeat.
Contributed by Olle Jonsson.
GitHub issue: #262
The HUTCH_URI
environment variable now can be used to configure
Hutch connection URI.
Contributed by Sam Stickland.
GitHub issue: #270
This release contains a breaking change in the error handlers interface.
Previously error handlers were provided a message ID as first
argument to ErrorHandler#handle
. Now it is a hash of all message
properties.
This is a breaking public API change. If you do not use custom error handlers, you are not affected.
Contributed by Pierre-Louis Gottfrois.
GH issue: hutch#238
Contributed by Olle Jonsson.
Contributed by Matt Thompson.
Hutch will no longer try to daemonize its process on JRuby (since it is not supported) and will emit a warning instead.
Contributed by Olle Jonsson.
Hutch::Worker
now accepts a list of callables that are invoked
after queue setup.
Contributed by Kelly Stannard.
Hutch::Broker
was refactored with some bits extracted into separate
classes or methods, making them easier to override.
Contributed by Aleksandar Ivanov and Ryan Hosford.
:consumer_pool_abort_on_exception
is a new option
(defaults to false
) which defines whether Bunny's
consumer work pool threads should abort on exception.
The option is ignored on JRuby.
Contributed by Seamus Abshere.
Received messages used to be logged using severity level INFO. This has been lowered to DEBUG.
Contributed by Jesper Josefsson.
Olle Jonsson and Kelly Stannard have contributed multiple internal improvements that have no behaviour changes.
Contributed by Jesper Josefsson.
Rails application detection now won't produce false positives
for applications that include config/environment.rb
. Instead,
bin/rails
and script/rails
are used.
Contributed by @bisusubedi.
Contributed by Jesper Josefsson and Olle Jonsson.
Hutch::Exception
now inherits from Bunny::Exception
which
inherits from StandardError
.
GH issue: #137.
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:
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.
: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 is updated to 2.2.1.
Hutch now supports pluggable serialisers: see Hutch::Serializer::JSON
for
an example. Serialiser is configured via Hutch config as a Ruby
class.
Contributed by Dmitry Galinsky.
Hutch now depends on multi_json 1.11.x
.
Bunny is updated to 2.2.0.
:mq_tls_ca_certificates
and :mq_verify_peer
options will now be passed on to Bunny as :tls_ca_certificates
and :verify_peer
respectively.
Contributed by Kennon Ballou.
Hutch will now use March Hare when running on JRuby. This will yield significant throughput and core utilisation improvements for workloads with many and/or busy consumers.
Contributed by Teodor Pripoae.
:consumer_pool_size
is a new option (defaults to 1
) which defines
Bunny consumer work pool size.
Contributed by Derek Kastner.
:client_logger
is a new option that allows
for configuring loggerd used by Bunny, the underlying
RabbitMQ client library.
Contributed by Nate Salisbury.
Fixes an issue with NoMethodError
in Hutch::Config
.
Hutch now automatically enables TLS and changes default port
when URI scheme is amqps
.
Contributed by Carl Hörberg.
Hutch now uses HashWithIndifferentAccess
internally
to reduce use of symbols (which are not garbage collected
by widely used Ruby versions).
Contributed by Teodor Pripoae.
Contributed by Nate Salisbury.
Ruby 1.9 is no longer supported by Hutch (and soon Bunny 2.0). 1.9 is also no longer maintained by the Ruby core team.
Allow to set custom arguments per consumers by using the arguments
setter.
Arguments are usually used by rabbitmq plugins or to set queue policies. You can
find a list of supported arguments here.
Contributed by Pierre-Louis Gottfrois.
Allow to track message processing by using the :tracer
config option,
the value should be a class (or fully-qualified string name of a class) that
implements the tracing interface.
A tracer that performs NewRelic instrumentation ships with Hutch and requires New Relic gem to be loaded.
Contributed by Mirosław Nagaś.
Consumers can now call a logger method to write to Hutch's log.
Contributed by Matty Courtney
Socket read and write timeouts are now configurable using
the read_timeout
and write_timeout
options, respectively.
Contributed by Chris Barton.
...as opposed to Ruby object printing.
Contributed by Andrew Morton.
Config now supports a new option: :heartbeat
, which is passed
on to Bunny.
Contributed by Simon Taranto.
Contributed by Daniel Farrell.
Hutch.connected?
no longer relies on an ivar and always returns
an up-to-date value.
Contributed by Pierre-Louis Gottfrois.
HTTP API use can be disabled for consumers using the :enable_http_api_use
config
option (defaults to true).
Hutch no longer relies on Kernel#autoload
to load its key
modules and classes.
Contributed by Pierre-Louis Gottfrois.
hutch --version
no longer fails with an exception.
Contributed by Olle Jonsson.
All Hutch exceptions now inherit from Hutch::Exception
.
Contributed by Pierre-Louis Gottfrois.
:force_publisher_confirms
is a new configuration option that forces Hutch.publish
to wait
for a confirm for every message published. Note that this will cause a significant drop in throughput:
Hutch::Config.set(:force_publisher_confirms, true)
Hutch::Broker#confirm_select
and Hutch::Broker#wait_for_confirms
are new public API methods
that delegate to their respective Bunny::Channel
counterparts. Hutch::Broker#confirm_select
can be used to handle confirms with a callback instead of waiting:
broker.confirm_select do |delivery_tag, multiple, nack|
# ...
end
Bunny is updated to 1.6.0.
Hutch now supports a new configuration key, :uri
, which allows
connection configuration via a URI.
Note that since the URI has to include credentials, this option is not available on the command line.
Bunny is updated to 1.5.1
, which mitigates the POODLE attack
by disabling SSL 3.0 where possible.
Error handlers will now have access to message payload.
Contributed by Daniel Farrell.
Exceptions in error handlers no longer prevent messages from being
basic.nack
-ed.
:pidfile
is a new configuration option that stores Hutch process
PID in a file at provided path.
Contributed by Rustam Sharshenov.
Bunny's delivery_info
, properties
and payload are now accessible on Hutch::Message
.
Contributed by gregory.
Hutch::Config
constructor now accepts an extra hash of optional
configuration parameters.
Contributed by Ignazio Mostallino.
Hutch will no longer attempt to register signal traps for signals not supported by the environment (e.g. on by certain OSes).
Contributed by Tobias Matthies.
Hutch now properly passes client TLS key and certificate to Bunny.
Contributed by Eric Nelson.
Bunny is updated to 1.2.x which should offer much better latency for workloads with lots of small messages published frequently.
Hutch::CLI#run
now accepts a parameter and is easier to use
in automated tests.
Uncaught exceptions in consumers now result in Hutch rejecting
messages (deliveries) using basic.nack
. This way they are dead lettered.
Contributed by Garrett Johnson.
hutch/consumer.rb
no longer fails to load with the
apps that do not require "set"
.
Contributed by Garrett Johnson.
Namespaces now can include any characters that are valid in RabbitMQ queue names.
Contributed by Garrett Johnson.
It is now possible to configure basic.qos
(aka channel prefetch) setting
used by Hutch using the :channel_prefetch
config key.
Hutch now elides passwords from logs.
It is now possible to make Hutch not use RabbitMQ HTTP API (e.g. when the RabbitMQ management plugin that provides it is not available).
Extra options passed to Hutch::Broker#publish
will now be propagated.
Messages published with Hutch now have content type set
to application/json
.
Hutch now uses heartbeat interval of 30, so heartbeats won't interfere with transfers of large messages over high latency networks (e.g. between AWS availability regions).
It is now possible to specify an optional queue name:
class FailedPaymentConsumer
include Hutch::Consumer
consume 'gc.ps.payment.failed'
queue_name 'failed_payments'
def process(message)
mark_payment_as_failed(message[:id])
end
end
Global properties can now be specified for publishing:
Hutch.global_properties = proc {
{ app_id: 'api', headers: { request_id: RequestId.request_id } }
}
- Metadata can now be passed in to
#publish
- Raise an exception when publishing fails
- Support for the
--mq-tls-key
and--mq-tls-cert
configuration options.
- No exception raised when hutch is run with no consumers. Instead, a warning is logged.
- Internal refactoring: use Bunny's shiny
ConsumerWorkPool#threads
attr_reader.
- Friendlier Message#inspect, doesn't spew out detailed bunny info.
- More autoloading tweaks, all internal modules are now autoloaded.
- Autoload the Broker module, which was missed in the previous release.
- Autoload internal modules. Fixes regression where the
Config
module was not available by simplyrequire
inghutch
.
- Support for loading configuration from a file, specified with the
--config
command line option.
- Add
--[no-]autoload-rails
flag to optionally disable the autoloading of Rails apps in the current directory
- Fix inconsistency with
mq-tls
option
- Support for connecting to RabbitMQ with TLS/SSL. There are two new
configuration options :
mq-tls
andmq-api-ssl
. - JSON message parsing errors are now handled properly.
- Relax Bunny dependency specification
- Initial release