Domanda

I'm afraid the response is a big NO, but i will expose the scenario i try to implement. Maybe someone sees a better way to do it.

We have a fanout exchange, representing a conversations between N users (conv1) We have two exchanges named user1, user2, binded to conv1, where conv1 is the source, Each of this user exchanges is binded to conv1, with conv1 as destination, with routing key conv1

If we send a message trough exchange user1 with routing key "conv1", the message reaches all consumers connected to user1 and user2 exchanges.

A user should be able to have more more than one consumer listening to his exchange

What i need to do is that when there's no consumer attached to a user exchange, those messages could be queued, and received via the user exchange when connected. My first idea was to put a queue between the user exchange and the conversation exchange, so the flow would go like:

consumer-user1 --> tempqueue --> user1 --> conv1 --> queueuser2 --> user2 --> consumer-user2

But it seems it's not possible to make the binding queueuser2 --> user2 in that direction.

If i make consumers to listen directly to this queueuserN, by binding them to conv1 instead of binding the user exchanges:

consumer-user1 --> tempqueue --> user1 --> conv1 --> queueuser2 --> consumer-user2

Then (ovbiously) the message only reaches one of the N possible connected consumers.

There is any way to do this? It seems that the shovel plugin does that, but between brokers...

È stato utile?

Soluzione

You can use the alternate exchange RabbitMQ extension: its purpose is exactly to reroute messages that cannot be sent to any queue, and would otherwise be lost.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top