Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

reading and setting JMSXUserID

886634Nov 7 2011 — edited Nov 8 2011
Hi,

I have a question regarding the proper usage for standard properties that start with JMSX. In particular, I want to be able to read the JMSXUserID property for each message. However, after receiving a message, the JMSXUserID property comes out to be null. The following line is the code I am using:

System.out.println("JMSXUserID: " + message.getStringProperty("JMSXUserID"));

Am I supposed to set the JMSXUserID when I first send the message? It works when I add the following line:

message.setStringProperty("JMSXUserID", "hostName");

However, in the MQ Developer's guide for Java Clients, it states:

"The JMS specification defines certain standard properties, listed in Table 2–7 . By convention, the names of all such standard properties begin with the letters JMSX; names of this form are reserved and must not be used by a client application for its own custom message properties. "

With that said, I would have expected an exception thrown after I set the JMSXUserID to be "hostName". Can someone please clarify how I am supposed to access these standard JMSX properties?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 6 2011
Added on Nov 7 2011
5 comments
915 views