1

Is there way for queue to wait till a task/message/item is completed in processing before it sends the next task/message/item to another consumer? This is the scenario I am trying to accomplish:

  • Three consumers (cons_A, cons_B, cons_C) subscribe to one queue (task_queue)
  • When publisher adds a task to the 'task_queue', the queue sends (or one of consumer subscribes) to the task (let's say cons_B subscribes).
  • Upon another task addition tot he 'task_queue', the queue blocks other consumers from subscribing until the the ongoing consumption is completed (until cons_B responds with completion doesn't matter if its success or not).

The queue/exchange waits for the ongoing task to complete before letting another consumer subscribe to the next task.

I am thinking of setting the queue size to "1" and wait for confirmation of the task complete when it subscribed by consumer. But this doesn't seem like the best approach as the tasks added during consumption get rejected.

Is it possible to do so in RabbitMQ?

ozn
  • 1,990
  • 3
  • 26
  • 37

1 Answers1

0

The RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.


As far as I know this scenario is not supported out of the box. If you describe your use-case on the mailing list someone who has implemented something similar may provide input.

Luke Bakken
  • 8,993
  • 2
  • 20
  • 33