Show Table of Contents
10.4.7. Create and Delete Dynamic Exchange Routes
- To create and delete dynamic exchange routes, use the following syntax:
qpid-route [OPTIONS] dynamic add <dest-broker> <src-broker> <exchange> qpid-route [OPTIONS] dynamic del <dest-broker> <src-broker> <exchange>
- Create a new topic exchange on each of two brokers:
$ qpid-config -a localhost:10003 add exchange topic fed.topic $ qpid-config -a localhost:10004 add exchange topic fed.topic
- Create a dynamic exchange route that routes messages from the
fed.topicexchange on the source brokerlocalhost:10004to thefed.topicexchange on the destination brokerlocalhost:10003:$ qpid-route dynamic add localhost:10003 localhost:10004 fed.topic
Internally, this creates a private autodelete queue on the source broker, and binds that queue to thefed.topicexchange on the source broker, using each binding associated with thefed.topicexchange on the destination broker. - In many applications, messages published to the destination exchange must also be routed to the source exchange. Create a second dynamic exchange route, reversing the roles of the two exchanges:
$ qpid-route dynamic add localhost:10004 localhost:10003 fed.topic
- Specify the
-doption to persist the exchange route. The exchange route will be restored if one or both of the brokers is restarted:$ qpid-route -d dynamic add localhost:10004 localhost:10003 fed.topic
When an exchange route is durable, the private queue used to store messages for the route on the source exchange is also durable. If the connection between the brokers is lost, messages for the destination exchange continue to accumulate until it can be restored. - The
delcommand takes the same arguments as theaddcommand. Delete the first exchange route described above:$ qpid-route dynamic del localhost:10004 localhost:10003 fed.topic
Internally, this deletes the bindings on the source exchange for the private queues associated with the message route.

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.