Sending reply back to Caller using javax.jms.message.replyTo
azeemdin Apr 21, 2012 3:03 AMHi,
I am new to ESB, need experts advise about my scenario please.
I want a request/response function to be implemented based on JMS Listener. Following is my jboss-esb.xml
<?xml version="1.0"?> <jbossesb parameterReloadSecs="5" xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd"> <providers> <jms-provider connection-factory="QMGR" jndi-URL="Server:1416/SYSTEM.ADMIN.SVRCONN" jndi-context-factory="com.ibm.mq.jms.context.WMQInitialContextFactory" name="JMSP"> <jms-bus busid="JMSC"> <jms-message-filter dest-name="TEST.MCR" dest-type="QUEUE" /> </jms-bus> </jms-provider> </providers> <services> <service category="test" description="test" invmScope="GLOBAL" name="test"> <listeners> <jms-listener busidref="JMSC" is-gateway="true" name="JMSL" /> </listeners> <actions mep="RequestResponse"> <action class="org.jboss.soa.esb.actions.SystemPrintln" name="show"> <property name="message" value="Hello" /> <property name="printfull" value="true" /> </action> </actions> </service> </services> </jbossesb>
Here is the output:
10:17:35,993 INFO [STDOUT] Hello: 10:17:35,993 INFO [STDOUT] [ message: [ JBOSS_XML ] header: [ To: InVMEpr [ PortReference < <wsa:Address invm://7465737424242424242424242424242474657374/false?false#10000/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/invm/>, <wsa:ReferenceProperties jbossesb:passByValue : false/> > ] MessageID: b1cc3e74-2749-4a1c-bd6e-74833619029a ] context: {} body: [ objects: {org.jboss.soa.esb.message.defaultEntry=<HELLO></HELLO>, org.jboss.soa.esb.message.defaultEntry-set-stack=java.lang.Exception: setPayload stack trace for 'org.jboss.soa.esb.message.defaultEntry'.} ] fault: [ ] attachments: [ Named:{}, Unnamed:[] ] properties: [ {JMS_IBM_Format=MQSTR , JMSXDeliveryCount=1, javax.jms.message.replyTo=queue://SERVER/TEST.N, JMSXUserID=mqm , JMS_IBM_MsgType=1, JMS_IBM_PutApplType=11, javax.jms.message.redelivered=false, org.jboss.soa.esb.gateway.original.queue.name=TEST.MCR, JMS_IBM_PutDate=20120418, JMS_IBM_PutTime=07173547, JMSXAppID=\MQUtil\bin\Debug\MQUtil.exe} ] ]
Now what should I do to send reply message back to:
javax.jms.message.replyTo=queue://SERVER/TEST.N (as shown in the output)
Please help.
----------------------
No response so far? Can anyone please tell me if it is possible or not?
I was able to send message back to Queue using NotifyQueues
<action class="org.jboss.soa.esb.actions.Notifier" name="route-to-response"> <property name="okMethod" value="notifyOK"/> <property name="destinations"> <NotificationList type="OK"> <target class="NotifyQueues"> <queue connection-factory="QMGR" jndi-URL="Server:1416/SYSTEM.ADMIN.SVRCONN" jndi-context-factory="com.ibm.mq.jms.context.WMQInitialContextFactory" jndiName="TEST.N"/> </target> </NotificationList> </property> </action>
It worked fine, but this is for fix Queue on service side. Can same idea be used for utilizing replyTo information in JMS message?