C
C
Crash2020-06-16 21:32:51
RabbitMQ
Crash, 2020-06-16 21:32:51

How to get all elements of a RabbitMQ queue?

It is necessary to read the contents of the queue at a certain interval and upload it to the database. After that, the queue is cleared and filled again.

Please tell me how to implement. I did not find it in the documentation, although I may not have looked well.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2020-06-16
@inoise

You can't get "all messages from the queue". You get them one by one without ack, write them to the database, then do ack. You can look towards the basic.consume method .
And in general you work with queue. No need to make a batch from the queue. This is unnatural. Especially considering that the queue size is not initially known

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question