ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Replying to JMS messages

Post new topic  Reply to topic
 Replying to JMS messages « View previous topic :: View next topic » 
Author Message
ekmo_74
PostPosted: Thu Mar 04, 2010 11:49 pm    Post subject: Replying to JMS messages Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Mar 05, 2010 1:04 pm    Post subject: Re: Replying to JMS messages Reply with quote

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
View user's profile Send private message Send e-mail
ekmo_74
PostPosted: Mon Mar 08, 2010 11:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Mar 09, 2010 2:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Replying to JMS messages
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.