Reputation: 4009
I try to make chat application using RabbitMQ.
Every conversation group has fanout
exchange, to which group members push messages and bind their queues.
But with such routing members receive their own messages, so I have to filter them in the client code.
Is there any way how to make exclude pattern matching, so exchange would not send message to the queue with the same key?
Upvotes: 0
Views: 1498
Reputation: 72868
Is there any way how to make exclude pattern matching
nope.
routing keys only match, not exclude
Upvotes: 1
Reputation: 10202
You could use headers exchange instead of fanout.
A headers exchange is designed for routing on multiple attributes that are more easily expressed as message headers than a routing key. Headers exchanges ignore the routing key attribute. Instead, the attributes used for routing are taken from the headers attribute. A message is considered matching if the value of the header equals the value specified upon binding.
Upvotes: 0