Ruby RabbitMQ clients blog

News and updates about various Ruby clients for RabbitMQ

Bunny 1.0.1 Is Released

TL;DR

Bunny 1.0.1 is released to rubygems.org.

This is a JRuby-specific bug fix release. We encourage all Bunny users to upgrade to it.

Changes between Bunny 1.0.0 and 1.0.1

Default CA’s Paths Are Disabled on JRuby

Bunny uses OpenSSL provided CA certificate paths. This caused problems on some platforms on JRuby (see jruby/jruby#155).

To avoid these issues, Bunny no longer uses default CA certificate paths on JRuby (there are no changes for other Rubies), so it’s necessary to provide CA certificate explicitly.

Fixes CPU Burn on JRuby

Bunny now uses slightly different ways of continuously reading from the socket on CRuby and JRuby, to prevent abnormally high CPU usage on JRuby after a certain period of time (the frequency of EWOULDBLOCK being raised spiked sharply).

Full change log can be found on GitHub.

About the Author

Michael on behalf of the Ruby RabbitMQ Clients Team

Amqp Gem 1.1.1 Is Released

TL;DR

amqp gem 1.1.1 is released to rubygems.org.

This is a bug fix release that is 100% backwards compatible.

Changes between amqp gem 1.1.0 and 1.1.1

Fixed Exception in AMQP::Exchange#handle_declare_ok

AMQP::Exchange#handle_declare_ok no longer raises an exception about undefined method #anonymous?.

Michael on behalf of the Ruby RabbitMQ Clients Team

Bunny 1.0.0 Is Released

TL;DR

Bunny 1.0.0 is released to rubygems.org.

This is the 1.0.0 GA release, a major milestone for Bunny. It is 100% backwards compatible with 0.10.x.

Finally 1.0.0

Bunny is not a new library. Started in early 2009 by Chris Duncan, it was full of limitations for a few years. However, it also was the easiest Ruby client to use and did not have some inherent limitations of amqp gem.

In 2012 and 2013, Bunny pretty much rewritten from scratch for the 0.9.0 release to address the limitation, as well as redesign it for the multicore CPUs age. In addition, documentation guides were ported from amqp gem. Dozens refinement releases and a few RCs later, it is in a good shape to go 1.0.

Since 0.9.0 shipped, Bunn has being adopted by many commercial users and fairly mature open source projects, such as Hutch.

If you are new to Bunny, take a look at the documentation. Then join rabbitmq-discuss and Ruby RabbitMQ clients mailing list.

We hope you will enjoy using Bunny!

Changes between Bunny 1.0.0.rc2 and 1.0.0

Authentication Failure Notification Support

Bunny::AuthenticationFailureError is a new auth failure exception that subclasses Bunny::PossibleAuthenticationFailureError for backwards compatibility.

As such, Bunny::PossibleAuthenticationFailureError’s error message has changed.

This extension is available in RabbitMQ 3.2+.

Bunny::Session#exchange_exists?

Bunny::Session#exchange_exists? is a new predicate that makes it easier to check if a exchange exists.

It uses a one-off channel and exchange.declare with passive set to true under the hood.

Bunny::Session#queue_exists?

Bunny::Session#queue_exists? is a new predicate that makes it easier to check if a queue exists.

It uses a one-off channel and queue.declare with passive set to true under the hood.

Inline TLS Certificates and Keys

It is now possible to provide inline client certificate and private key (as strings) instead of filesystem paths. The options are the same:

  • :tls which, when set to true, will set SSL context up and switch to TLS port (5671)
  • :tls_cert which now can be a client certificate (public key) in PEM format
  • :tls_key which now can be a client key (private key) in PEM format
  • :tls_ca_certificates which is an array of string paths to CA certificates in PEM format

For example:

1
2
3
4
conn = Bunny.new(:tls                   => true,
                 :tls_cert              => ENV["TLS_CERTIFICATE"],
                 :tls_key               => ENV["TLS_PRIVATE_KEY"],
                 :tls_ca_certificates   => ["./examples/tls/cacert.pem"])

Changes between Bunny 1.0.0.rc1 and 1.0.0.rc2

Ruby 1.8.7 Compatibility Fixes

Ruby 1.8.7 compatibility fixes around timeouts.

Changes between Bunny 1.0.0.pre6 and 1.0.0.rc1

amq-protocol Update

Minimum amq-protocol version is now 1.8.0 which includes a bug fix for messages exactly 128 Kb in size.

Add timeout Bunny::ConsumerWorkPool#join

Bunny::ConsumerWorkPool#join now accepts an optional timeout argument.

About the Author

Michael on behalf of the Ruby RabbitMQ Clients Team

Bunny 1.0.0.rc3 Is Released

TL;DR

Bunny 1.0.0.rc3 is released to rubygems.org.

This is a minor feature and usability release. We encourage all Bunny users to upgrade to it.

Changes between Bunny 1.0.0.rc2 and 1.0.0.rc3

Authentication Failure Notification Support

Bunny::AuthenticationFailureError is a new auth failure exception that subclasses Bunny::PossibleAuthenticationFailureError for backwards compatibility.

As such, Bunny::PossibleAuthenticationFailureError’s error message has changed.

This extension is available in RabbitMQ 3.2+.

Bunny::Session#exchange_exists?

Bunny::Session#exchange_exists? is a new predicate that makes it easier to check if a exchange exists.

It uses a one-off channel and exchange.declare with passive set to true under the hood.

Bunny::Session#queue_exists?

Bunny::Session#queue_exists? is a new predicate that makes it easier to check if a queue exists.

It uses a one-off channel and queue.declare with passive set to true under the hood.

Inline TLS Certificates and Keys

It is now possible to provide inline client certificate and private key (as strings) instead of filesystem paths. The options are the same:

  • :tls which, when set to true, will set SSL context up and switch to TLS port (5671)
  • :tls_cert which now can be a client certificate (public key) in PEM format
  • :tls_key which now can be a client key (private key) in PEM format
  • :tls_ca_certificates which is an array of string paths to CA certificates in PEM format

For example:

1
2
3
4
conn = Bunny.new(:tls                   => true,
                 :tls_cert              => ENV["TLS_CERTIFICATE"],
                 :tls_key               => ENV["TLS_PRIVATE_KEY"],
                 :tls_ca_certificates   => ["./examples/tls/cacert.pem"])

Full change log can be found on GitHub.

Michael on behalf of the Ruby RabbitMQ Clients Team

March Hare 2.0.0.rc3 Is Released

TL;DR

March Hare 2.0.0.rc3 is released to rubygems.org.

This release is a release candidate of 2.0 that introduces another usability improvement.

2.0 should be production ready from the stability perspective but has breaking API changes.

Changes Between 2.0.0-rc2 and 2.0.0-rc3

Consumer Work Pool Tuning Improvements

MarchHare 1.x used to maintain a separate executor (thread pool) per non-blocking consumer. This is not optimal and reimplements the wheel RabbitMQ Java client already has invented: it dispatches consumer methods in a thread pool maintained by every connection.

Instead of maintaining its own executor, MarchHare now relies on the Java client to do the job. The key difference is that 1.x versions used to maintain a thread pool per channel while 2.x has a thread pool per connection.

rc3 introduces an easier way to configure the executor: it is now sufficient to only provide pool size. For example:

1
MarchHare.connect(:thread_pool_size => 16)

It is still possible to override the executor when opening a connection by providing an executor factory (any Ruby callable):

1
2
3
MarchHare.connect(:executor_factory => Proc.new {
  MarchHare::ThreadPools.fixed_of_size(16)
})

Change Log

Full change log for 2.0 is available on GitHub.

Michael on behalf of the Ruby RabbitMQ Clients Team

Amqp Gem 1.1.0 Is Released

TL;DR

amqp gem 1.1.0 is released to rubygems.org.

This release includes a couple of usability improvements, internal code reorganization (amq-client is no longer used), amq-protocol update and more long time deprecated API elements removed.

All users are encouraged to upgrade.

Changes Between 1.0.0 and 1.1.0

amq-protocol Update

Minimum amq-protocol version is now 1.8.0 which includes a bug fix for messages exactly 128 Kb in size.

AMQ::Client is Removed

amq-client has been incorporated into amqp gem. AMQ::Client and related modules are no longer available.

AMQP::Channel#confirm_select is Now Delayed

AMQP::Channel#confirm_select is now delayed until after the channel is opened, making it possible to use it with the pseudo-synchronous code style.

RabbitMQ Extensions are Now in Core

amqp gem has been targeting RabbitMQ exclusively for a while now.

RabbitMQ extensions are now loaded by default and will be even more tightly integrated in the future.

AMQP::Channel.default is Removed

AMQP::Channel.default and method_missing-based operations on the default channel has been removed. They’ve been deprecated since 0.6.

AMQP::Channel#rpc is Removed

AMQP::RPC-related code has been removed. It has been deprecated since 0.7.

AMQP::Channel.on_error is Removed

Long time deprecated AMQP::Channel.on_error is removed.

Michael on behalf of the Ruby RabbitMQ Clients Team

Amqp Gem 1.0.3 Is Released

TL;DR

amqp gem 1.0.3 is released to rubygems.org.

This release has bug fixes.

Changes between amqp gem 1.0.2 and 1.0.3

amq-protocol 1.8.0 Compatibility

amqp gem 1.0.3 is now compatible amq-protocol 1.8.0: using amqp(s) URI’s won’t result in an exception.

Michael on behalf of the Ruby RabbitMQ Clients Team

RabbitMQ HTTP API Client 0.7.0 Is Released

Ruby RabbitMQ HTTP API client 0.7.0 is released.

This is a minor feature release.

Changes Between 0.6.0 and 0.7.0

Support for Basic HTTP Auth Credentials in URI

It is now possible to pass credentials in the endpoint URI:

1
c = RabbitMQ::HTTP::Client.new("https://guest:guest@127.0.0.1:15672/")

Changes Between 0.5.0 and 0.6.0

Support for Advanced Connection Options

It is now possible to pass more options to Faraday connection, for example, HTTPS related ones:

1
2
3
4
5
6
7
c = RabbitMQ::HTTP::Client.new("https://127.0.0.1:15672/", username: "guest", password: "guest", ssl: {
  client_cer: ...,
  client_key: ...,
  ca_file:    ...,
  ca_path:    ...,
  cert_store: ...
})

Any options other than username and password will be passed on to Faraday::Connection.

Changes Between 0.4.0 and 0.5.0

Endpoint Reader

RabbitMQ::HTTP::Client#endpoint is a new reader (getter) that makes it possible to access the URI a client instance uses.

Full change log can be found on GitHub.

Michael on behalf of the Ruby RabbitMQ Clients Team