Ruby RabbitMQ clients blog

News and updates about various Ruby clients for RabbitMQ

March Hare 2.5.1 Is Released

TL;DR

March Hare 2.5.1 is released to rubygems.org.

This is a bug fix and usability release.

Changes Between 2.5.0 and 2.5.1

Better Bunny Compatibility: the Heartbeat Option

MarchHare.connect now accepts :heartbeat as an alias for :heartbeat_requested for better Bunny compatibility (and because API reference accidentally listed it).

GH issue: #57.

Full Change Log

Please consult the change log to learn about the changes.

About the Author

Michael on behalf of the Ruby RabbitMQ Clients Team

March Hare 2.5.0 Is Released

TL;DR

March Hare 2.5.0 is released to rubygems.org.

This is primarily a bug fix release.

Changes Between 2.4.0 and 2.5.0

Bugfixes

  • Consumers are now properly unregistered from their owning channel during recovery (#52)
  • Sessions in recovery are no longer reported active until recovery has fully completed (#55)
  • Error 320 (connection-forced) is now properly handled (#53)
  • Fixed a race condition that could cause subscriptions utilizing manual acks to fail immediately after recovery (#54)

Contributed by Chris Heald.

Full Change Log

Please consult the change log to learn about the changes.

About the Author

Michael on behalf of the Ruby RabbitMQ Clients Team

March Hare 2.4.0 Is Released

TL;DR

March Hare 2.4.0 is released to rubygems.org.

This is a minor feature release.

MarchHare::Exchange#publish Options Bunny Compatibility

MarchHare::Exchange#publish now accepts property options the same way as Bunny does (the old way with the :properties option is still supported). This improves March Hare and Bunny API compatibility.

The new way:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
exchange.publish(payload,
                 :app_id      => "hotbunnies.tests",
                 :persistent  => true,
                 :priority    => 8,
                 :type        => "kinda.checkin",
                 # headers table keys can be anything
                 :headers     => {
                   "coordinates" => {
                     "latitude"  => 59.35,
                     "longitude" => 18.066667
                   },
                   "time"         => @now,
                   "participants" => 11,
                   "venue"        => "Stockholm",
                   "true_field"   => true,
                   "false_field"  => false,
                   "nil_field"    => nil,
                   "ary_field"    => ["one", 2.0, 3, [{ "abc" => 123 }]]
                 },
                 :timestamp        => @now,
                 :reply_to         => "a.sender",
                 :correlation_id   => "r-1",
                 :message_id       => "m-1",
                 :content_type     => "application/octet-stream",
                 # just an example. MK.
                 :content_encoding => "zip/zap",
                 :routing_key    => "hotbunnies.key")

The old way:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
exchange.publish(payload,
                 :properties => {
                   :app_id      => "hotbunnies.tests",
                   :persistent  => true,
                   :priority    => 8,
                   :type        => "kinda.checkin",
                   # headers table keys can be anything
                   :headers     => {
                     "coordinates" => {
                       "latitude"  => 59.35,
                       "longitude" => 18.066667
                     },
                     "time"         => @now,
                     "participants" => 11,
                     "venue"        => "Stockholm",
                     "true_field"   => true,
                     "false_field"  => false,
                     "nil_field"    => nil,
                     "ary_field"    => ["one", 2.0, 3, [{ "abc" => 123 }]]
                   },
                   :timestamp        => @now,
                   :reply_to         => "a.sender",
                   :correlation_id   => "r-1",
                   :message_id       => "m-1",
                   :content_type     => "application/octet-stream",
                   # just an example. MK.
                   :content_encoding => "zip/zap"
                 },
                 :routing_key    => "hotbunnies.key")

Contributed by Devin Christensen.

Full Change Log

Please consult the change log to learn about the changes.

About the Author

Michael on behalf of the Ruby RabbitMQ Clients Team

March Hare 2.3.0 Is Released

TL;DR

March Hare 2.3.0 is released to rubygems.org.

This is a minor feature release.

Changes Between 2.2.x and 2.3.0

Custom Exception Handler Support

March Hare now provides a way to define a custom (unexpected) exception handler RabbitMQ Java client will use:

1
2
3
4
5
6
7
8
9
class ExceptionHandler < com.rabbitmq.client.impl.DefaultExceptionHandler
  include com.rabbitmq.client.ExceptionHandler

  def handleConsumerException(ch, ex, consumer, tag, method_name)
    # ...
  end
end

MarchHare.connect(:exception_handler => ExceptionHandler.new)

An exception handler is an object that conforms to the com.rabbitmq.client.ExceptionHandler interface.

Custom Thread Factories Support

Certain environments (e.g. Google App Engine) restrict thread modification. RabbitMQ Java client 3.3 can use a custom factory in those environments.

March Hare now exposes this functionality to Ruby in a straightforward way:

1
2
3
java_import com.google.appengine.api.ThreadManager

MarchHare.connect(:thread_factory => ThreadManager.background_thread_factory)

A thread factory is an object that conforms to the j.u.c.ThreadFactory interface:

1
2
3
4
5
6
7
class ThreadFactory
  include java.util.concurrent.ThreadFactory

  def newThread(runnable)
    # e.g. java.lang.Thread.new(runnable)
  end
end

RabbitMQ Java Client Upgrade

RabbitMQ Java client dependency has been updated to 3.3.4.

Full Change Log

Please consult the change log to learn about the changes.

About the Author

Michael on behalf of the Ruby RabbitMQ Clients Team

RabbitMQ HTTP API Client 1.2.0 Is Released

Ruby RabbitMQ HTTP API client 1.2.0 is released.

This release restores Ruby 1.8 compatibility.

Changes Between 1.1.0 and 1.2.0

Ruby 1.8 Compatibility Restored

The library no longer uses 1.9-specific hash syntax.

Changes Between 1.0.0 and 1.1.0

declare_exchange

It is now possible to declare an exchange over HTTP API using RabbitMQ::HTTP::Client#declare_exchange:

1
c.declare_exchange("/", exchange_name, :durable => false, :type => "fanout")

Contributed by Jake Davis (Simple).

Changes Between 0.9.0 and 1.0.0

Hashi Upgrade

The library now depends on hashie ~> 2.0.5.

Faraday Upgrade

The library now depends on faraday ~> 0.8.9.

Change Log

Full change log can be found on GitHub.

About the Author

Michael on behalf of the Ruby RabbitMQ Clients Team

Amqp Gem 1.4.0 Is Released

TL;DR

amqp gem 1.4.0 is released to rubygems.org.

This release includes a minor feature.

Changes Between 1.3.x and 1.4.0

connection.blocked Support

connection.blocked notifications are now correctly supported by the library:

1
2
3
4
5
6
7
8
9
10
11
EventMachine.run do
  connection = AMQP.connect(:host => '127.0.0.1')

  connection.on_blocked do |conn, conn_blocked|
    puts "Connection blocked, reason: #{conn_blocked.reason}"
  end

  connection.on_unblocked do |conn, _|
    puts "Connection unblocked"
  end
end

Full Change Log

Full change log can be found on GitHub.

About the Author

Michael on behalf of the Ruby RabbitMQ Clients Team

Bunny 1.3.1 Is Released

TL;DR

Bunny 1.3.1 is released to rubygems.org.

This is a bug fix release.

Changes between Bunny 1.3.0 and 1.3.1

NoMethodError on Thread During Shutdown

During abnormal termination, Bunny::Session#close no longer tries to call the non-existent terminate_with method on its origin thread.

Full Change Log

Full change log can be found on GitHub.

About the Author

Michael on behalf of the Ruby RabbitMQ Clients Team

Bunny 1.3.0 Is Released

TL;DR

Bunny 1.3.0 is released to rubygems.org.

This is a minor feature and bug fix release.

Changes between Bunny 1.3.0 and 1.2.0

TLS Can Be Explicitly Disabled

TLS now can be explicitly disabled even when connecting (without TLS) to the default RabbitMQ TLS/amqps port (5671):

1
conn = Bunny.new(:port => 5671, :tls => false)

Contributed by Muhan Zou.

Single Threaded Connections Raise Shutdown Exceptions

Single threaded Bunny connections will now raise exceptions that occur during shutdown as is (instead of trying to shut down I/O loop which only threaded ones have).

Contributed by Carl Hörberg.

Synchronization Improvements for Session#close

Bunny::Session#close now better synchronizes state transitions, eliminating a few race condition scenarios with I/O reader thread.

Bunny::Exchange.default Fix

Bunny::Exchange.default no longer raises an exception.

Note that it is a legacy compatibility method. Please use Bunny::Channel#default_exchange instead.

Contributed by Justin Litchfield.

GH issue #211.

Bunny::Queue#pop_as_hash Removed

Bunny::Queue#pop_as_hash, which was added to ease migration to Bunny 0.9, was removed.

Bunny::Queue#pop Wraps Metadata

Bunny::Queue#pop now wraps basic.get-ok and message properties into Bunny::GetResponse and Bunny::MessageProperties, just like basic.consume deliveries.

GH issue: #212.

Better Synchronization for Publisher Confirms

Publisher confirms implementation now synchronizes unconfirmed set better.

Contributed by Nicolas Viennot.

Channel Allocation After Recovery

Channel id allocator is no longer reset after recovery if there are channels open. Makes it possible to open channels on a recovered connection (in addition to the channels it already had).

Full Change Log

Full change log can be found on GitHub.

About the Author

Michael on behalf of the Ruby RabbitMQ Clients Team

Bunny 1.2.2 Is Released

TL;DR

Bunny 1.2.2 is released to rubygems.org.

This is a bug fix release.

Changes between Bunny 1.2.1 and 1.2.2

Synchronization Improvements for Session#close

Bunny::Session#close now better synchronizes state transitions, eliminating a few race condition scenarios with I/O reader thread.

Bunny::Exchange.default Fix

Bunny::Exchange.default no longer raises an exception.

Note that it is a legacy compatibility method. Please use Bunny::Channel#default_exchange instead.

Contributed by Justin Litchfield.

GH issue #211.

Full Change Log

Full change log can be found on GitHub.

About the Author

Michael on behalf of the Ruby RabbitMQ Clients Team