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 IndexIBM MQ Java / JMSSetting from jms a custom property in MQRFH2 usr folder

Post new topicReply to topic
Setting from jms a custom property in MQRFH2 usr folder View previous topic :: View next topic
Author Message
what?
PostPosted: Wed Apr 11, 2018 4:38 am Post subject: Setting from jms a custom property in MQRFH2 usr folder Reply with quote

Newbie

Joined: 05 Mar 2012
Posts: 3

Hi All,
I have a multi tier application where a jms message is sent from a JmsTemplate (Spring) to a WMB Flow. In the jms message I could set MQMD headers in order to set meta-info required by the WMB flow listening on an MQQueue.

What I should still do and that is causing issues to me is setting a custom property/header in the JMS message, in MQRFH2 usr folder. I want to set there a key named MYKEY with a string value.

What I'm doing in the jms message is this:

message.setStringProperty(WMQConstants.JMS_IBM_MQMD_FORMAT, "MQRFH2"); message.setStringProperty("MQRFH2.usr.MYKEY", "testvalue");

but I'm getting the error:

JMSCC0049: The property name 'MQRFH2.usr.MYKEY' is not a valid Java(tm) identifier.; nested exception is com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0049: The property name 'MQRFH2.usr.MYKEY' is not a valid Java(tm) identifier

Does anyone knows how to set the MQRFH2 usr customer property named MYKEY into a jms message in usr folder into MQRFH2 ?
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Wed Apr 11, 2018 11:08 am Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3062
Location: London, ON Canada

If you are using the MQRFH2 class then you do:

Code:
rfh2.setFieldValue("usr", "SomeText", "TEST");


If your application is using the IBM MQ classes for JMS then you do:

Code:
msg.setStringProperty("SomeText", "TEST");


Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
what?
PostPosted: Wed Apr 11, 2018 11:59 am Post subject: Just jms classes, no MQ Reply with quote

Newbie

Joined: 05 Mar 2012
Posts: 3

Thanks !

I'm using pure jms classes, no MQ and doing

msg.setStringProperty("MYKEY", "TEST");

where msg is a javax.jms.Message

causes low level MQ traces to show:

RFH .......�.......�MQSTR ......�..., <mcd> <Msd>jms_text</Msd> <Type>1</Type> </mcd>...� <jms> <Dst>queue:///OUTQUEUE</Dst> <Rto>queue://QMGR/REPTOQ</Rto> <Tms>1523399291439</Tms> <Exp>1523399311439</Exp> <Dlv>1</Dlv> </jms>...� <usr> <MESSAGE_TYPE>1</MESSAGE_TYPE> <ReplyToQ>REPTOQ</ReplyToQ> <ReplyToQMgr>QMGR</ReplyToQMgr> <APPLICATION_NAME>MyJmsClient</APPLICATION_NAME> <MYKEY>rO0AB..</MYKEY>

That should mean we are also ok in this scenario, without MQ APIs. Am I right ?


Last edited by what? on Thu Apr 12, 2018 1:20 am; edited 1 time in total
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Wed Apr 11, 2018 12:12 pm Post subject: Re: Just jms classes, no MQ Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3062
Location: London, ON Canada

what? wrote:
That should mean we are also ok in this scenario, without MQ APIs.

Yes, your "MYKEY" & value are in the 'usr' folder which is where it belongs.

what? wrote:
causes low level MQ traces to show:

Not very user friendly. As per my blog posting here, you should use a tool that understands a JMS (aka MQRFH2) message.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSSetting from jms a custom property in MQRFH2 usr folder
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.