Questo contenuto non è disponibile nella lingua selezionata.

4.6.2. Publish to a Queue using the Default Exchange


All queues automatically bind to the default exchange using the queue name as the binding key. So all you need to do to publish to a queue bound to the default exchange is to declare a queue. The binding to the Default Exchange is created automatically. Since the Default Exchange is a direct exchange, and is nameless, sending a message to the queue name is sufficient for it to arrive in your queue.
To create a queue named "quick-publish" bound to the Default Exchange using qpid-config:
qpid-config add queue quick-publish
Copy to Clipboard Toggle word wrap
In an application, queues can be created as a side-effect of creating a sender object. If the address contains the parameter {create: always} then the queue will be created if it does not already exist. In addition to always, the create command can also take the arguments sender and receiver, to indicate that the queue should be created only when a sender connects to the address, or only when a receiver connects to the address.
Here is the creation of the "quick-publish" example queue:
Python
sender = session.sender("quick-publish; {create: always}")
Copy to Clipboard Toggle word wrap
C++
Sender sender = session.createSender("quick-publish; {create: always}")
Copy to Clipboard Toggle word wrap
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