Aggregator in RabbitMQ

Is it possible to implement the aggregator pattern in RabbitMQ?

I have A

... N

messages that I need to wait / aggregate before sending to another queueX

So I think I will have some kind of unique identifier that ensures that messages are forwarded exclusively to the same consumer and then wait for all messages to arrive.

Is this possible in RabbitMQ?

+5


source to share


1 answer


Yes it is possible.

But this is not specific to RabbitMQ. Understanding what to collect and how to do it is not the responsibility of the message broker.



You need to write a service to subscribe to the relevant messages and then post the result back. In the context of RabbitMQ, you can use routing keys to ensure that the correct consumer receives messages, but this is not the only way.

0


source







All Articles