简体   繁体   English

JMS ReplyTo,在发送请求的其他JMS提供程序中创建临时队列

[英]JMS replyTo, create Temporary Queue in different JMS provider where request is sent

With JMS, there is a concept of Temporary Queue. 使用JMS,有一个临时队列的概念。 It is a queue, which exists only in the particular JMS connection. 它是一个队列,仅存在于特定的JMS连接中。 It is created during transaction by the client, and is destroyed when the connection is closed. 它由客户端在事务处理期间创建,并在连接关闭时销毁。 Temporary Queue may be used as a JMS replyTo address per se JMS API. 临时队列可用作JMS API本身的JMS ReplyTo地址。 It is convenient way to implement request-reply pattern with JMS. 这是使用JMS实现请求-答复模式的便捷方法。

But is it possible to open JMS connections to two distinct JMS servers in different WebLogic domains , create Temporary Queue in other JMS server and use it as a replyTo address in the message sent to another JMS server? 但是是否可以打开到不同WebLogic域中的 两个不同 JMS服务器的JMS连接,在其他JMS服务器中创建临时队列,并将其用作发送到另一JMS服务器的消息中的replyTo地址? Also, JMS servers in both WebLogic domains are clustered (distributed destinations) if that matters. 此外,如果需要的话,两个WebLogic域中的JMS服务器都将群集(分布式目标)。

在此处输入图片说明

  1. For the transaction, Service 1 creates Temporary Queue in it's JMS provider 对于事务,服务1在其JMS提供程序中创建临时队列
  2. Service 1 sends message to another JMS provider in different domain. 服务1将消息发送到不同域中的另一个JMS提供程序。 Message contains the Temporary Queue as replyTo address. 邮件包含临时队列作为replyTo地址。 Service 1 blocks until reply message arrives at the Temporary Qeueue. 服务1阻塞,直到回复消息到达临时队列。
  3. Service 2 MDB handles the incoming request message 服务2 MDB处理传入的请求消息
  4. Service 2 sends reply message to Service 1's Temporary Qeueue. 服务2将回复消息发送到服务1的临时队列。
  5. Service 1 handles the incoming reply message. 服务1处理传入的回复消息。

There will be multiple instances of both services. 两种服务都将有多个实例。 Also, message may be routed even further to another domains from Service 2 before being returned to Service 1. The Temporary Queue replyTo address must endure all the "hops" in the route. 同样,在返回到服务1之前,消息甚至可以从服务2路由到另一个域。临时队列的replyTo地址必须忍受路由中的所有“跃点”。 Is this possible with pure Java EE? 纯Java EE是否可以实现?

What you want to do here isn't possible simply by using the JMSReplyTo message header because the JMS specification does not define any link between a Destination and a physical location. 仅通过使用JMSReplyTo消息头就不可能在这里做任何事情,因为JMS规范没有定义Destination和物理位置之间的任何链接。 A Destination is essentially just a reference to an implementation-specific name where the message will be sent. Destination本质上只是对将消息发送到的实现特定名称的引用。 That said, you could include additional properties in the message with the details required to connect to the proper remote server (eg name of the connection factory and IP/port for the JNDI lookup). 就是说,您可以在消息中包括其他属性,以及连接到适当的远程服务器所需的详细信息(例如,连接工厂的名称和JNDI查找的IP /端口)。

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

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