Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Example of using RabbitMQ's Federation Plugin with Ruby-AMQP
Ruby Shell
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
node1 Switch to the new federation config in rabbitmq 3.1
node2 Switch to the new federation config in rabbitmq 3.1
.gitignore Switch to the new federation config in rabbitmq 3.1
Gemfile Switch to the new federation config in rabbitmq 3.1
Gemfile.lock Switch to the new federation config in rabbitmq 3.1
README.md Switch to the new federation config in rabbitmq 3.1
cleanup.sh Switch to the new federation config in rabbitmq 3.1
consumer_from_node1.rb Switch to the new federation config in rabbitmq 3.1
consumer_from_node2.rb Switch to the new federation config in rabbitmq 3.1
create-federations.sh Switch to the new federation config in rabbitmq 3.1
producer_to_node1.rb
producer_to_node2.rb Switch to the new federation config in rabbitmq 3.1
start-node1.sh Switch to the new federation config in rabbitmq 3.1
start-node2.sh Switch to the new federation config in rabbitmq 3.1

README.md

ruby-amqp-federation-example

Example of using RabbitMQ's Federation Plugin with Ruby-AMQP

Step 1 - Start RabbitMQ Nodes (in 2 separate terminals)

bash start-node1.sh
bash start-node2.sh
  • Node 1 runs on port: 25672, management interface: 55555
  • Node 2 runs on port: 35672, management interface: 55556

Step 2 - Prepare environment and create federations

bundle install
bash cleanup.sh
bash create-federations.sh

Step 3 - Start the Consumer/Producer

From separate terminals, run:

ruby consumer_from_node1.rb
ruby consumer_from_node2.rb

Then try producing messages to either node, both will receive the messages:

ruby producer_to_node2.rb
Something went wrong with that request. Please try again.