2018-08-21 23:37:13 +08:00
# RabbitMQ Consistent Hash Exchange Examples in Ruby
2018-08-21 23:36:15 +08:00
2018-08-21 23:48:07 +08:00
This directory contains runnable Ruby examples for the [RabbitMQ Consistent Hash Exchange plugin ](https://github.com/rabbitmq/rabbitmq-consistent-hash-exchange/ ).
2018-08-21 23:36:15 +08:00
They are the same examples as in the [plugin's README ](../../README.md ) file.
## Prerequisites
The examples assume a RabbitMQ node with the `rabbitmq_consistent_hash_exchange` plugin
enabled is running on `localhost` and that default user credentials and virtual host
were not deleted.
## Dependency Installation
``` sh
2018-08-21 23:37:13 +08:00
bundle install
2018-08-21 23:36:15 +08:00
```
## Running the Example
``` sh
# hashing on the routing key
2018-08-21 23:37:13 +08:00
bundle exec ruby ./example1.rb
2018-08-21 23:36:15 +08:00
# hashing on a custom header
2018-08-21 23:37:13 +08:00
bundle exec ruby ./example2.rb
2018-08-21 23:36:15 +08:00
# hashing on a message property
2018-08-21 23:37:13 +08:00
bundle exec ruby ./example3.rb
2018-08-21 23:36:15 +08:00
```