Show Table of Contents
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
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}")- C++
Sender sender = session.createSender("quick-publish; {create: always}")

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.