basic_get with explicit no_ack=True, ack message, it should not
See original GitHub issueHey
The following example below auto ack message - rabbitmq receive a get auto_auto ack whereas it should receive get manual_ack. Until I do not call myself ack the message should stay in the queue.
channel init :
connection:pika.BlockingConnection = pika.BlockingConnection(pika.URLParameters(amqp_url))
self._channel:BlockingChannel = connection.channel()
self._channel.confirm_delivery()
self._channel.queue_declare(queue=self._queue, durable=True, passive=True, auto_delete=False)
while(True):
method_frame, header_frame, body = self._channel.basic_get(queue=self._queue, no_ack=True)
Here the result payload of my debug :
b’\x00<\x00F’, b’\x00\x00’, b’\x1f’, b’el.support.destination.ingester’, b’\x01’ marshal result : b"\x01\x00\x01\x00\x00\x00’\x00<\x00F\x00\x00\x1fel.support.destination.ingester\x01\xce"
What’s the problem ? or what i’m doing wrong ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
RabbitMQ Basic Recover Doesn't Work - Stack Overflow
Messages can be consumed in two ways noAck=false or noAck=true. noAck is a parameter on both Model.BasicConsume and Model.BasicGet.
Read more >Consumer Acknowledgements and Publisher Confirms
Therefore, automatic message acknowledgement should be considered unsafe and not suitable for all workloads. Another thing that's important to consider when ...
Read more >Channel - javadoc.io
While a Channel can be used by multiple threads, it's important to ensure that ... i.e. with explicit acks // some deliveries take...
Read more >FAQ: RabbitMQ Basic Consumer vs. RabbitMQ Basic Get
The RabbitMQ client registers with the broker and waits for messages. Consumers can acknowledge receipt automatically and use a cancellation ...
Read more >RabbitMQ Operation Timeout Exception in BasicGet
Impl.AutorecoveringModel.BasicGet(String queue, Boolean autoAck) When this error is occurring the message is not received in consumer and not acknowledged ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
no_ack=True
indicates that the message does not require an acknowledgement and will be instantly acknowledged on delivery. You should useno_ack=False
if you need to manually ack messages.confirm_delivery
turns on publisher confirms, which is a different feature.Please see the documentation here:
https://www.rabbitmq.com/confirms.html
here is fix
import pika
class RabbitMQ(): def init(self): connection = pika.BlockingConnection() self.channel = connection.channel() # del connection self.channel.confirm_delivery() self.body = None
if name == ‘main’: rabbit = RabbitMQ() for i in range(6): rabbit.publish(‘test’,f’Hello World! {i}')