简体   繁体   中英

How to have Bunny process one message at a time with RabbitMQ?

When I use Bunny, when I open a connection to a queue that has 50,000 messages using:

queue = channel.queue('test.queue', :durable => true)
queue.subscribe(:manual_ack => true) do ...

RabbitMQ moves ALL the messages from READY to UNACKED immediately, thus leaving none in READY .

If I try to spin up another Bunny using the same code, it now has nothing to read off READY .

Am I missing something obvious?

Figured it out. I didn't set pre_fetch .

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