0

I have two queues

For example:

A = ['foo', 'abo', 'aboba', 'bar'];
B = [];

I'd like to move only 'aboba', 'bar' from queue A to B. It doesn't matter which side of A to cut.

I know about rabbitmq shovel, but I don't found tools for my case in this plugin.

Gregory Sysoev
  • 173
  • 1
  • 15
  • Does this answer your question? [Moving messages between queues rabbitMQ](https://stackoverflow.com/questions/22645517/moving-messages-between-queues-rabbitmq) and [Is it possible to move / merge messages between RabbitMQ queues?](https://stackoverflow.com/questions/17075116/is-it-possible-to-move-merge-messages-between-rabbitmq-queues/26814659#26814659) – Luuk Apr 04 '22 at 07:24
  • @Luuk, Unfortunately no. I have seen these questions. I only need to transfer a few messages. Not all messages from the queue *A* – Gregory Sysoev Apr 04 '22 at 07:32
  • And [this](https://stackoverflow.com/a/22646229/724039) might solve your problem, but I cannot oversee if that creates another problem (this = reading all messages from the queue, and re-post them to the correct queue) – Luuk Apr 04 '22 at 07:38
  • @Luuk, yes. This solution will create another problem. – Gregory Sysoev Apr 04 '22 at 07:45
  • OK, then I do not know if it is possible, – Luuk Apr 04 '22 at 07:53

1 Answers1

0

In your example you could set a max-length-policy to 2 and then use a shovel to move the remaining messages.

This is not a general solution as you might not know at which depth in the queue you are to create the cut.

jrhodin
  • 659
  • 5
  • 14