此内容没有您所选择的语言版本。

10.4.7. Create and Delete Dynamic Exchange Routes


  1. 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>
    
    Copy to Clipboard Toggle word wrap
  2. 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
    
    Copy to Clipboard Toggle word wrap
  3. Create a dynamic exchange route that routes messages from the fed.topic exchange on the source broker localhost:10004 to the fed.topic exchange on the destination broker localhost:10003:
    $ qpid-route dynamic add localhost:10003 localhost:10004 fed.topic
    
    Copy to Clipboard Toggle word wrap
    Internally, this creates a private autodelete queue on the source broker, and binds that queue to the fed.topic exchange on the source broker, using each binding associated with the fed.topic exchange on the destination broker.
  4. 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
    
    Copy to Clipboard Toggle word wrap
  5. Specify the -d option 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
    
    Copy to Clipboard Toggle word wrap
    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.
  6. The del command takes the same arguments as the add command. Delete the first exchange route described above:
    $ qpid-route dynamic del localhost:10004 localhost:10003 fed.topic
    
    Copy to Clipboard Toggle word wrap
    Internally, this deletes the bindings on the source exchange for the private queues associated with the message route.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat