I'm attempting to shard an exchange to multiple queues using the x-consistent-hash exchange type. (I'm also evaluating the sharding plugin, but at the moment x-consistent-hash seems like a better fit for my use case.) I've bound 4 queues to my test exchange,
each with routing key "10". All messages are coming into the exchange with the same routing key, it's not easy to make the key unique across producers in my setup. Since the same routing key will always go to the same queue per the docs, I've set the hash-property
argument on the exchange to hash off a message property field. However, I'm noticing all the messages tend to only go to one of the queues. With {"hash-property": "timestamp"} all the messages went to queue 0. As an experiment I changed to {"hash-property":
"message_id"} and now all messages are going to queue 1.
I set up the exchange with the following commands (obviously erasing the exchange and queues between these commands):
rabbitmqadmin --config /etc/rabbitmqadmin.conf -V /es declare exchange 'name=es' type=x-consistent-hash auto_delete=false internal=false durable=true arguments='{"hash-property": "timestamp"}'
rabbitmqadmin --config /etc/rabbitmqadmin.conf -V /es declare exchange 'name=es' type=x-consistent-hash auto_delete=false internal=false durable=true arguments='{"hash-property": "message_id"}'
Have I missed a required configuration option?
Is there a better option to round-robin messages with identical routing keys between queues with this exchange type?
Thanks!
Tom Noonan II
DevOps Engineer
CONFIDENTIALITY NOTICE: The information contained in this e-mail message and any attachments is for the sole use of the intended recipients and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient and have received this communication in error, please contact the sender by reply e-mail and destroy all copies of the original message. Thank you.