We have: 2 queues - messages and error_messages, in case of an error, the message falls into error_message, each message has a unique ID.

The business process is as follows: the administrator monitors error_messages, makes edits for a specific message, and then restarts processing by moving the specific message back to the messages queue.

Now it is implemented in MsSql.

Question: Is it possible in rabbitmq to transfer only one message from one queue to another?

ps There is a command Move messages, but it transfers all messages, which is wasteful, you need to transfer only one message.

  • but it can not just once again be published in the right place? - tym32167 1:53 pm
  • It is possible, but then there will be a similar task - to remove a specific message from the error_message queue. - alfaSigma7i
  • Well, you remove it from the queue for processing, it no longer remains in it, or I misunderstood you - tym32167
  • Thank you for interested in my question. The fact is that from tutorials rabbitmq, for each queue there is a handler (s), and it processes all messages from the queue. And the question is whether it is possible to pull out specific messages, somehow. Theoretically, you can put a condition in the handler if it contains a message under a certain ID => to remove from the queue, but then we get infinite traffic from error_queue. - alfaSigma7i

2 answers 2

It is logical to do something like:

The administrator reads the message from the queue with errors indicating the requeue: false. Further, depending on the situation, the message must be sent either back to the same queue or to another queue with tasks.

You can do this automatically, if an error occurs, the message gets into the dead letter exchange (DLX), so it gets to the queue in the routing key in which you can lie as long as you need, and then return to the task queue itself, this is convenient when temporary errors occur and the need for guaranteed message delivery. Plus, it is convenient to monitor the sump line (if it began to grow, then something went wrong).

Read more about DLX here:

https://www.rabbitmq.com/dlx.html

https://habr.com/ru/post/235505/

  • The closest answer to the question. It dawned on me, the queue and the queue to issue messages sequentially, you can’t just say “Hey you message number 101 go for processing” (in DB this is possible by changing the value of the column, but the database tables and queue are different data structures) - alfaSigma7i

The queue and the queue to issue messages sequentially, you can not just say "Hey you message number 101 go for processing." In the database this is possible by changing the value of the column, but the database tables and the queue are different data structures.