|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to retrieve properties (using JMS code) set by WMQI |
« View previous topic :: View next topic » |
Author |
Message
|
giln |
Posted: Thu Aug 14, 2003 6:05 am Post subject: How to retrieve properties (using JMS code) set by WMQI |
|
|
Newbie
Joined: 14 Aug 2003 Posts: 1
|
Hello,
I have added few String properties in the message and send it to MQ Version
5.3 using JMS. It was added to the Queue Sucessfully. But when I read the message back and tried to
extract these Properties, it was returing NULL. I tried to print all the Properties.
These are the total properties available in the message. {JMS_IBM_PutDate=20030711,
JMSXAppID=Websphere MQ Client for Java, JMS_IBM_PutApplType=28, JMS_IBM_Format=MQSTR ,
JMSXUserID=MUSR_MQADMIN, JMS_IBM_MsgType=8, JMS_IBM_PutTime=20051043, JMSXDeliveryCount=1}
I dont know If I have to set anything in MQ or in Java Client while creating the Queue/Queue
Manager.
The JMS code I'm using to retrieve the properties is:
....
String msgBody, xptName;
Map xptAttr = new HashMap();
runFlag = true;
try {
while (runFlag) {
try {
//get message from Q
TextMessage mqMessage = ((TextMessage) (receiver.receive()));
msgBody = mqMessage.getText();
xptName = mqMessage.getStringProperty(XCEPTION_NAME);
String attrName;
Object attrObject;
Enumeration enum = mqMessage.getPropertyNames();
while (enum.hasMoreElements()) { //put attributes
attrName = (String)enum.nextElement(); attrObject = mqMessage.getObjectProperty(attrName);
xptAttr.put(attrName, attrObject);
}
.....
Can you send me a sample code of the message creation (JMS code)
and/or the setting of the properties using WMQI?
Please help. |
|
Back to top |
|
 |
EddieA |
Posted: Thu Aug 14, 2003 3:43 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
The Properties that you can set/retrieve are User properties and are in the <usr> folder. In your example code, that would be XCEPTION_NMAE, but that isn't in the message, again from your description.
All the JMS Properties, like the ones you show, are in the <jms> folder are are set/retrieved by predefined methods.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
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
|
|
|
|