Questo contenuto non è disponibile nella lingua selezionata.

5.2.3. Message Rejection


After acquiring a message on a reliable link your application can reject it. When a message is rejected the broker will delete it from the queue. If the queue is configured with an alternate exchange, then the rejected message is routed there; otherwise it is discarded.
To reject a message using the Python API, call the acknowledge() method of the session, passing in the message that you wish to reject, and specify REJECTED as the Disposition parameter:
Python
msg = rx.fetch(timeout = 1)
    
if msg.content == "something we don't like":
  ssn.acknowledge(msg, Disposition(REJECTED))
else:
  ssn.acknowledge(msg)
Copy to Clipboard Toggle word wrap
Note that this is only possible when using a reliable link. When using an unreliable link, mesages are implicitly acknowledged when they are fetched.
Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat