consume, cancel and draining the local buffer

20 views
Skip to first unread message

Lars Strojny

unread,
Aug 4, 2023, 4:31:08 AM8/4/23
to rabbitmq-c-users
Hi,

scenarios is this, assume 5 messages in a queue and this sequence:
  1. amqp_basic_consume() with a prefetch count = 5
  2. call amqp_consume_message() once, neither ack nor nack (still 4 messages locally buffered)
  3. call amqp_basic_cancel()
Now I want the put the channel in a pristine state, so the next consume will not read orphaned messages. amqp_basic_recover() after cancel will help already and put back all the messages. Question is: is there a better way to drain the local buffer than to call amqp_consume_message() in a loop?

cu
Lars


Reply all
Reply to author
Forward
0 new messages