简体   繁体   English

WMQ在队列管理器之间复制消息

[英]WMQ copy messages between queue managers

I have a queue Q1 on queue manager QMA and an app A reading the data from Q1. 我在队列管理器QMA上有一个队列Q1,并且有一个应用A从Q1读取数据。 The data from Q1 needs to be replicated to another queue Q2 on queue manager QMB with app A still reading from Q1 and Q2 also getting the message. 来自Q1的数据需要复制到队列管理器QMB上的另一个队列Q2,同时应用A仍从Q1和Q2读取消息。 I make Q1 an alias queue which posts its data on a topic (TopicA) to which Q2 has subscribed via a remote queue. 我将Q1设置为别名队列,该别名队列将其数据发布到Q2通过远程队列订阅的主题(TopicA)上。 Q2 is able to get the data. Q2能够获取数据。 The problem is app A which was reading from Q1 is not able to get the data. 问题是正在从Q1读取的应用程序A无法获取数据。 Can this be re-modelled so that both app A and Q2 gets the data? 可以重新建模以便应用程序A和Q2都获取数据吗?

Create another durable subscription for TopicA with destination as Q3 and change your application get messages from queue Q3 instead of Q1 . TopicA创建另一个持久订阅,目标为Q3并更改应用程序从队列Q3而不是Q1获取消息。 When an application puts message to Q1 (basically to alias topic TopicA ) that message gets routed to both Q2 on QMB and Q3 on QMA . 当应用程序将消息放入Q1 (基本上是别名TopicA )时,该消息将同时路由到QMB上的Q2QMA上的Q3

If you are able to change the queue for your putting application, then follow below steps: 如果您能够更改您的放置应用程序的队列,请按照以下步骤操作:

  1. Make Q1 as local queue instead of alias queue. 使Q1作为本地队列而不是别名队列。
  2. Create another alias queue, say "Publisher", with Base object as topic and give your topic in destination as you did before. 创建一个别名队列,例如“ Publisher”,以基础对象作为主题,并像以前一样在目标中提供主题。
  3. Create Subscriptions for queue Q1, for your topic. 为您的主题为队列Q1创建订阅。
  4. Point your putting application to put messages in the "Publisher" queue instead of Q1. 将您的放置应用程序指向将消息放置在“发布者”队列中而不是Q1中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM