rabbitmq-server
rabbitmq-server copied to clipboard
"hash-header" argument support for x-modulus-hash exchange
Is your feature request related to a problem? Please describe.
Currently when we want to keep a correct order of messages using x-modulus-hash - the routing key must be the same. Sometimes we want to keep a correct processing order of different messages. Lets consider events:
- User X registered
- User X logged in
- User X performed action 1
- Used X performed action 2
- User X unregistered
If we want make sure that service using x-modulus-hash is processing these events in a correct order - we would need to keep all events under the same routing key lets say "userChanged.X"
Describe the solution you'd like
x-consistent-hash supports a hash-header argument where header is used for computing a hash instead of a routing key. The same solution could be used in x-modulus-hash to keep it consistent.
Describe alternatives you've considered
No response
Additional context
No response
These two exchange types were never meant to be mutually replaceable or to have feature parity.
Maybe they were not meant to be replaceable but as I just found out they are. I recently use RMQ to ensure message processing in a correct order in a distributed environment. Consistency of x-consistent-hash in picking right message queues is not critical for me and it appears that x-modulus-hash is ~4x times faster than x-consistent-hash while achieving the same goal perfectly fine. Its always nice to have some more ways of configuration as long as it makes sense. In my opinion letting system know how to hash messages to distribute them over queues is a required feature and the way it is done in x-consistent-hash is just one of possible options.