Sandeep Lakdawala
Sandeep Lakdawala

Reputation: 492

Rabbit MQ -Message Order Priority Consumption

Using Rabbit MQ Is there a way ,I can ensure all messages of Type A are consumed before messages of Type B.

Eg: if I have a pool of Product and Order messages, I want to make sure all Product messages are consumed before Order messages ? As Order belongs to a specific Product.So Order cannot exist without a Product.

Upvotes: 0

Views: 88

Answers (1)

Gary Russell
Gary Russell

Reputation: 174554

You could do it with two queues and two listeners, but that would be tricky; you would have to hold up the Order listener when a Product is missing and wait for it to arrive.

You could do it with a single queue and single concurrency as long as the producer always sends the Product before the Order.

Upvotes: 1

Related Questions