Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does RabbitMQ support hash partition like Kafka?

Tags:

rabbitmq

I have a RabbitMQ with multiple consumers subscribed on a single queue. And I want the messages with same hash key can be consumed by the same consumer for each time. I know the default behavior for RabbitMQ is loop through all consumers and dispatch the message 1 by 1.

Does it have the same ability like Kafka partition?

Thanks

like image 628
Gawain Avatar asked Oct 21 '25 05:10

Gawain


1 Answers

Well not exactly but a very close one .

You need to use RabbitMQ Consistent Hash Exchange Type which is available by adding the rabbitmq-consistent-hash-exchange plugin. It adds a consistent-hash exchange type to RabbitMQ. This exchange type uses consistent hashing to distribute messages between the bound queues. It is recommended to get a basic understanding of the concept before evaluating this plugin and its alternatives.

like image 197
Soumen Mukherjee Avatar answered Oct 26 '25 15:10

Soumen Mukherjee