This project is used to show a potential error in the consistent-hash plugin of RabbitMQ. rabbitmq/rabbitmq-consistent-hash-exchange#32
- dotnet sdk 3.1
- RabbitMQ 3.8.2 running with the rabbitmq_consistent_hash_exchange plugin
- An exchange of type
topic
namedexchange-in
- An exchange of type
x-consistent-hash
namedexchange-consumer
connected to theexchange-in
exchage - 5 queues named
consumer.0
throughconsumer.4
with a binding toexchange-consumer
an
When sending a batch of 5000 messages each message should go to the same queue even after a restart of RabbitMQ.
To execute the test, following the following steps multiple times:
- execute
dotnet run .
- examine the number of messages in the consumer queueus and make note of the number per queue
- on the rabbitmq instance call:
rabbitmqctl stop_app
- on the rabbitmq instance call:
rabbitmqctl stop_app
- examine the number of messages in the consumer queueus these should be all 0
- repeat from step 1 until the values in step 2 are different for 1 or more queues
After a restart it can't be garanteed that messsages will be sent to the same queue.