Questo contenuto non è disponibile nella lingua selezionata.
7.3.3. Asynchronously Acknowledging Received Messages
acquired
on the broker until they are acknowledged by the consumer. When a message is in acquired
mode it is not visible in the queue. If the consumer disconnects without acknowledging receipt, the message will be moved out of acquired
and again become available to consumers, with the header redelivered=true
.
acknowledge()
method of the session
object:
- Python
session.acknowledge()
session.acknowledge()
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
acknowledge()
method with no arguments acknowledges receipt of all as-yet-unacknowledged messages fetched using that session. To acknowledge a specific message, pass the message as an argument. For example:
- Python
msg = rx.fetch(timeout = 1) session.acknowledge(msg)
msg = rx.fetch(timeout = 1) session.acknowledge(msg)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
sync = False
parameter:
- Python
session.acknowledge(msg, sync = False)
session.acknowledge(msg, sync = False)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
When an unreliable
link is requested for a receiver, acknowledgement is implicit when a message is fetched. This means that the broker marks the message as acquired as soon as the receiver fetches it. No acknowledgement is necessary, and no release or rejection of messages is possible.