使用 websphere 消息代理在队列管理器之间路由消息

Routing messages between queue managers using websphere message broker

如何使用 WebSphere Message 代理实例在驻留在两个队列管理器中的队列之间路由消息。消息代理实例在创建期间只能与一个队列管理器相关联。所以我创建了一个 MQInputNode 并将消息放入特定的源队列。我关心的是使用相同的代理实例将此消息路由到驻留在另一个队列管理器中的第二个队列。如何?我使用的是 WebSphere Message Broker 版本 8.0.0.8。尚未进入 IIB。

下面是一个简单有效的方法。

假设,您的经纪人在 QM1 上。您在 QM2 中有一个名为 LQ_QM2 的本地队列。 并且您希望消息转到 LQ_QM2。按照以下步骤操作:

  1. At QM1, create a local queue of usage 'Transmission'. Let us name this transmission queue as "QM2".
  2. At QM1, create a sender channel named "QM1.QM2" with proper connection name (Contains host(port) of target queue manager, for eg 10.1.5.2(1144)) and set transmission queue as QM2 (The one we created in step 1).
  3. Create a receiver channel at QM2 named "QM1.QM2).
  4. Now create a remote queue definition at QM1. Let's name it as RQ_LQ_QM2. Set remote queue property as LQ_QM2 and transmission queue as QM2 and remote queue manager as QM2.
  5. The messages which you want to send to the queue LQ_QM2 can now be written by the broker to RQ_LQ_QM2 in QM1 itself.

如果您不能执行上述 MQ 操作并且必须仅使用消息代理功能,那么在 WMB 8 中执行此操作的方法是使用 Java 并编写一个 MQ 客户端使用 MQ API 库的代码。然后,您将使用 SVRCONN 通道与远程队列管理器建立远程连接,并将消息放入远程队列管理器的队列中。