|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Replying to JMS messages |
« View previous topic :: View next topic » |
Author |
Message
|
ekmo_74 |
Posted: Thu Mar 04, 2010 11:49 pm Post subject: Replying to JMS messages |
|
|
Newbie
Joined: 04 Mar 2010 Posts: 2
|
Hi,
I need to develop reply-functionality in Jms, i.e. I want to reply to incoming messages by reading reply-to queue and setting correlation id.
The sending application is a legacy app that sends messages without RFH2 header.
How do I write code that replies to the message and keeps properties such as persistence, CCSID, priority, etc.
I've not been able to find CCSID and persistence properties in the incoming JMS message.
(I've got the correlation id and reply-to part working alright).
Best regards,
/Martin |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Mar 05, 2010 1:04 pm Post subject: Re: Replying to JMS messages |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
ekmo_74 wrote: |
Hi,
I need to develop reply-functionality in Jms, i.e. I want to reply to incoming messages by reading reply-to queue and setting correlation id.
The sending application is a legacy app that sends messages without RFH2 header.
How do I write code that replies to the message and keeps properties such as persistence, CCSID, priority, etc.
I've not been able to find CCSID and persistence properties in the incoming JMS message.
(I've got the correlation id and reply-to part working alright).
Best regards,
/Martin |
You did not specify the MQ version.
With MQ V6 the QCF /TCF can have the matching targetClient attribute (default true)? Make sure you set it to true.
To suppress the RFH the destination needs to have the targetClient attribute set to 1 (MQSC.TARGET_CLIENT_MQ from memory) .
The outgoing CCSID should be set as well as an attribute of the destination.
If you need to determine the incoming CCSID inspect the possible properties on the message.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ekmo_74 |
Posted: Mon Mar 08, 2010 11:04 pm Post subject: |
|
|
Newbie
Joined: 04 Mar 2010 Posts: 2
|
Hi and thanks for the reply.
The MQ version is 6. I've found a way of setting CCSID and targetclient by building queue urls (queue://XXX/YY?targetClient=1 etc) when speciyfing destination. Hope that this is an ok way of doing it?
The major problem right now is how to read CCSID, persistence properties from the incoming message. I've tried to read the JMS_IBM_Character_Set property but it is null.
The received message is:
Code: |
JMS Message class: jms_text
JMSType: null
JMSDeliveryMode: 1
JMSExpiration: 1268118120833
JMSPriority: 3
JMSMessageID: ID:c1d4d840c5c4f9c5d4f0f440404040404b94a5c22032161e
JMSTimestamp: 1268118060833
JMSCorrelationID:null
JMSDestination: queue:///DUMMY.TEST?CCSID=273
JMSReplyTo: queue:///DUMMY2.TEST?targetClient=1
JMSRedelivered: false
JMS_IBM_PutDate:20100309
JMSXAppID:WebSphere MQ Client for Java
JMS_IBM_Format:MQSTR
JMS_IBM_PutApplType:28
JMS_IBM_MsgType:1
JMSXUserID:QMQM
JMS_IBM_PutTime:07005995
JMSXDeliveryCount:1 |
(The JMSDestination in this example is just for testing, the real sending application does not include CCSID in the destination).
/Martin |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Mar 09, 2010 2:02 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well looks like you want to do 2 things.
a) on the incoming message, get the list of keys and display the property value for each of the keys.
b) cast the JMSReplyTo destination to it's appropriate sub type and further cast that subtype to the provider type (ex Destination -> Queue->MQQueue.
You should then be able to inspect most of the attributes of said MQQueue.
Your next step is then in thinking how to build your replies in a generic mode...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|