I am using RabbitMq 3.7.16 and I have an exchange that I want to bind to one of two possible queues.
My use case is having the exchange bound to first queue and switching it to second queue, and then switch the binding back.
My Current Implementation
The exchange is of type direct and routing key for both is "".
When switching binding I perform Bind(second-queue) and then Unbind(first-queue). When switching back I do the opposite.
The problem
I've few milliseconds where both queues are bound to the exchange and thus receiving the same messages. I want every message to get to exactly one of the possible queues.
What is the right way to do such thing with RabbitMQ?