Details
-
Bug
-
Resolution: Done
-
Major
-
jboss-fuse-6.2.1
-
%
-
-
Sprint 7 - towards CR2
Description
- A JMS producer creates a message. It has the option to ask the receiver to respond to a specific address. Therefore there is a field called JMSReplyTo, https://docs.oracle.com/javaee/6/api/javax/jms/Message.html#setJMSReplyTo%28javax.jms.Destination%29
- There is a need of this field to be populated with TEST.REPORT.RRESP.
- The receiver reads the JMSReplyTo field (received with the message). If he is well behaved he will replies at the destination provided and send a message to TEST.REPORT.RRESP.
- The real scenario is with IBM MQ but with activemq you can imagine that you have composite queues defined, see: http://activemq.apache.org/virtual-destinations.html so that the name which is used by the receiver for replying: TEST.REPORT.RRESP is different from the name the producer is listening to the response TEST.REPORT.RESP.
- The producer receives the response at TEST.REPORT.RESP
Now the configuration with CXF is as follows:
- If you have the same queue name on both sides you set
<property name="replyDestination" value="TEST.REPORT.RESP" />
and you get two things:
- The header of the message is populated with JMSReplyTo = TEST.REPORT.RESP
- The producer is listening to get an answer at TEST.REPORT.RESP
- The thing is that the receiver does not know of TEST.REPORT.RESP. and needs to send the reply to TEST.REPORT.RRESP. This is not hard coded at the receiver level as for messages sent by other producers he may need to reply to TEST.REPORT.RRESP2. But, that's what the JMSReplyTo field is for, the producer is telling the receiver where he needs to send the response to. So now I want to keep my producer listening to TEST.REPORT.RESP, which is set by <property name="replyDestination" value="TEST.REPORT.RESP" /> but I want him to send a different value in the message header and that's what <property name="replyToDestination" value="TEST.REPORT.RRESP" /> is for. But it is not happening.
There is the need to use the JMSReplyTo header (using replyToDestination) and specify the queue from where the reply is sent to. This is different from where the reply is read from (replyDestination). The reason behind that is that mq brokers are used in conjunction with mq local managers. The topology is similar in some extend to a network of brokers. The local queues have names that are different, meaning the reply sent by the server to queue local_B is forwarded to the queue local_A on a different machine where the client is listening to.