Ruby RabbitMQ clients blog

News and updates about various Ruby clients for RabbitMQ

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