0
votes

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 ?

2

2 Answers

0
votes

Actually you only need to do this:

message.setStringProperty("MYKEY", "testvalue");

Such call will force using "MQRFH2" format and create a property "MYKEY" in "usr" folder.

The error you have received only states that property name must follow java identifier naming rules, i.e. dots are not allowed there.

0
votes

You don't set our own properties in the 'jms' folder but rather you set them in the 'usr' folder.

rfh2.setFieldValue("usr", "SomeNum", 123);
rfh2.setFieldValue("usr", "SomeText", "TEST");

For a complete example of creating A JMS (MQRFH2) Message in non-JMS Java Application, see here: http://www.capitalware.com/rl_blog/?p=4823