Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

RabbitMQ JRuby Client using Java RabbitMQ client

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 rabbitmq-jruby-client.gemspec
Octocat-spinner-32 workling_rabbitmq_client.rb
Octocat-spinner-32 workling_rabbitmq_subscriber.rb
RabbitMQ JRuby Client
rabbitmq-jruby-client allows you to use RabbitMQ Client from JRuby using the official Java RabbitMQ client from Rabbit Technologies
See more at

Getting Started
1. Install and start RabbitMQ (see below)
2. Install JRuby RabbitMQ Client: jruby -S gem install rabbitmq-jruby-client

Example Usage
gem 'rabbitmq-jruby-client'
require 'rabbitmq_client'

# Initializes the new client and connect to the server
client =

# Initializes a new queue
queue = client.queue('queue_name')

# Initializes a new exchange
exchange ='exchange_name')

# Connects queue with the exchange

# Publish a message to the queue
queue.publish('message body')

# Retrieve a message from the queue
message = queue.retrieve

# Subscribe to a queue with callback. (Event-driven)
queue.subscribe do |message|
  # do something with message

# Subscribe to a queue in a loop. (Polling)
queue.loop_subscribe do |message|
  # do something with message

Installing RabbitMQ on OS X
1. Install MacPorts
2. sudo port install rabbitmq-server

To run RabbitMQ
3. sudo rabbitmq-server
Something went wrong with that request. Please try again.