System architecture:
I have a RabbitMQ node with unallocated and allocated exchanges and queues. I have, for the sake of example 2 consuming microservices with n instances each and a broker utility microservice which is responsible for allocating (binding consumers), listening for incoming data messages, and other management functionality such as managing consumer pods.
Upon initialization, each consumer tells the broker utility microservice that it is ready to start consuming messages. In response, the broker utility will dedicate -- allocate a directed queue with routing key X (depending on message) for the consumer.
Scenario:
Message with routing key X comes in for microservice Y and if it is able to be routed by an allocated exchange to a dedicated queue then send it off to the proper consumer and we are happy. Otherwise we have a new routing key that has to be allocated and so put it through the unallocated exchange (fanout) to all pods within microservice Y and if the pod is "not consuming messages" -- i.e. is available to be allocated then the pod is allocated and a dedicated queue is attached to the pod. Now any future messages with routing key X will just go directly to the allocated pod.
Problem:
If two messages with the same routing key come in within a small time interval (in ms) then they are both processed as "unallocated" and so both are attached to two different pods and so future messages with the same routing key are duplicated amongst the two pods. There simply isn't enough time between processing both of these messages to register the routing key as "allocated".
Working solution (want to get rid of this):
Use a hazelcast lock to lock on the routing key. This puts a heavy strain on the system.
Reference diagram -- see attached
Is there a native way to lock on RabbitMQ routing keys? Is there a topology I can set up (perhaps exchange to exchange) which will fix this issue? Is there anything on the RabbitMQ side I can do? Can we set up unique routing keys (i.e. 1 queue per routing key)?
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/6f8f9c87-64e9-449a-bbf4-dc2b3329063cn%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/0zWUg1HoXUM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/CAA81d0sn22esra8zsfJP7usw48KanVE59p-K2QLw_NibR_UKkA%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/CACdsx4HAof85Xr9GrXqcLAsAM16p2FZ5mcZDbxd39H7q8SAD8g%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/CAA81d0vZeN31U7qMjLdEfzqmruTi-K338PSFp5x2f9NBJUmBuA%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/CACdsx4FDk7kXYGJ8iqzXsc6r3V7NiAVCMpA_oRBiJm6z3x4r%2BA%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/CAFrNoHRzEvASCn8oztsXwAOoBeySWyCr7sZWKZXYP104Yv2U5A%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/CACdsx4FbHxBeqOxGvtS972CM8BSKOLqkG1uxeLRHeJaBdJnyeQ%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/CAA81d0vL3MMGcz24ZG547KLoy7gwL%2BMYJTk1q8Riz8eznXBTRA%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/CACdsx4FUOfVsCnM1F9zi%3Di-9GZmFPgOyZL8KpXQe5bToaffx5w%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/CAA81d0tUma2EXK%3DMwcUE3tAV3cr0qXx5Df_bXQWySQ9_poz%2BnQ%40mail.gmail.com.