Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

7.3.3. Asynchronously Acknowledging Received Messages


A reliable link (technically called a link with at-least-once reliablity) is the default link used when a receiver is created without specifying a link reliability. For message acknowledgement on unreliable links refer to Acknowledging Messages Received Over an Unreliable Link. Messages received over a reliable link are set to 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.
To remove the message from the queue, a consumer needs to acknowledge receipt of the message.
In Python, this is done by calling the acknowledge() method of the session object:
Python
session.acknowledge()
Copy to Clipboard Toggle word wrap
Calling the 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)
Copy to Clipboard Toggle word wrap
This method executes synchronously by default, and will wait for the broker to respond before returning. It can also be invoked asynchronously, by supplying the sync = False parameter:
Python
session.acknowledge(msg, sync = False)
Copy to Clipboard Toggle word wrap
Acknowledging Messages Received Over an Unreliable Link

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.

Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat