简体   繁体   中英

How to get all the messages present in a single Queue in RabbitMQ in one call

How can I get all the messages published on a single queue in one call? I have to develop a java rest end point. when a call to that end point is made then we need to read the all messages present on a RabbitMQ during that call and I need to terminate the connection so that it is not continuously listening.

I am new to Rabbit MQ

What I understood from the RabbitMq .. We can not fetch all the messages from the queue. Because RabbitMq does not have any offset value concept. It will delete messages from the memory once it is processed data from the queue.

If you want to fetch all the data best to use Kafka instead of RabbitMq .

Because Kafka has the retain policy strategy which keeps the data by using offset value into the memory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM