• Post Reply Bookmark Topic Watch Topic
  • New Topic

JMS: report options

 
srk
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am writing a JMS application which sends a messages to a native appliaction, therefore i have to set the target client to JMSC.MQJMS_CLIENT_NONJMS_MQ (in order to supress the MQRFH2 headers).

My application expects to get a report back on arrival. Therefore
in my message I set the following properties

outMessage.setJMSCorrelationID("Msg-1"); // setting the correlation Id
outMessage.setIntProperty("JMS_IBM_Report_COA", 1792 ); // setting the report options
outMessage.setIntProperty("JMS_IBM_Report_Pass_Correl_ID",64); // To pass the correlation id of the request msg back


When I get the report message back my correlation id is not what i expect. However when I browse the report messages on my replyto queue (using MQExplorer) I can see that the correlation ID is set correctly to "Msg-1". But when I read the correlation Id programatically using getJMSCorrelationID() i get a generated hex value.

As per the MQ spec the JMSCorrelation Id is mapped to MQMD correlaId
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/csqzaw1481.htm

pasting the relevant code below
----------------------------------------

code:
--------------------------------------------------------------------------------

factory = new MQQueueConnectionFactory();(MQQueueConnectionFactory)factory).setQueueManager(QMGR);connection = factory.createQueueConnection();connection.start();boolean transacted = false;session = connection.createQueueSession( transacted, Session.AUTO_ACKNOWLEDGE);ioQueue = session.createQueue( QUEUE );((com.ibm.mq.jms.MQQueue)ioQueue).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);QueueSender queueSender = session.createSender(ioQueue);TextMessage outMessage = session.createTextMessage("Hello");outMessage.setJMSCorrelationID("ProcessControlMsg-1");outMessage.setIntProperty("JMS_IBM_Report_COA", 1792 );outMessage.setIntProperty("JMS_IBM_Report_Pass_Correl_ID",64); Queue reply = session.createQueue("DUMMY");outMessage.setJMSReplyTo(reply);queueSender.send(outMessage);QueueReceiver queueReceiver = session.createReceiver(reply);Message inMessage = queueReceiver.receive(0);System.out.println("Correl ID " + ((TextMessage)inMessage).getJMSCorrelationID());

--------------------------------------------------------------------------------



Any help would be much appreciated.

Thanks
srk
 
Mark Spritzler
ranger
Sheriff
Posts: 17290
9
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"srk"

Please click on the My Profile link above and change your display name to meet the JavaRanch Naming Policy of using your real first and real last names. Which would probably be Shradha Kampani.

You had it there before, but changed it. Please change it back or you account will be closed.

Thanks

Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!