|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Setting Message properties ( setStringProperty) |
« View previous topic :: View next topic » |
Author |
Message
|
ravi.nerella |
Posted: Thu Jan 22, 2004 6:25 am Post subject: Setting Message properties ( setStringProperty) |
|
|
Newbie
Joined: 22 Jan 2004 Posts: 3
|
Hi,
I am using BEA Weblogic Server. My Websphere MQ is also running.
Problem 1:
In Program 1, by Using Javax.jms API, I am cretating a Message. I had set one StringProperty to this message by using setStringProperty method. I am sending this message to one MQ Queue. I am able to see this message in the Queue by using websphere MQ Console.
Now in Program 2, I read this message. This message is not having the property that I had set at the sending side. Iverified by using propertyExists() method.
Can u plz help on this.
Thanks and Regards,
Ravi K Nerella. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 22, 2004 6:28 am Post subject: Re: Setting Message properties ( setStringProperty) |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
ravi.nerella wrote: |
Hi,
I am using BEA Weblogic Server. My Websphere MQ is also running.
Problem 1:
In Program 1, by Using Javax.jms API, I am cretating a Message. I had set one StringProperty to this message by using setStringProperty method. I am sending this message to one MQ Queue. I am able to see this message in the Queue by using websphere MQ Console. |
Can you see the property itself in the MQ console? That is, if you look at the contents of the message, can you see that it has an MQRFH2 header, and if that header contains the NameValue pair that setProperty should create?
If you don't see it in the raw message itself, then you aren't setting it properly.
If you do see it, then something is wrong with your program 2. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ravi.nerella |
Posted: Thu Jan 22, 2004 6:49 am Post subject: Setting Message properties ( setStringProperty) |
|
|
Newbie
Joined: 22 Jan 2004 Posts: 3
|
Hi JeffLowrey,
In MQ Console I counldn't find MQRFH2 header itself. I am not sure whether I am looking at correct location or not. I am looking at the Queue.
I am looking at
Console Root---> websphere MQ--->QueueManagers --> under this by selecting particular queue I am viewing its properties.
In the PDF ,Websphere MQ using Java, in Chapter 12 ( Page 229 ), it is given as
" The MQRFH2 is optional, and its inclusion in an outgoing message is governed by a flag in the JMS Destination class. You can set this flag using the WebSphere MQ JMS administration tool."
Here in Javax.jms API ,I couldn't find any flag.
Could you please help on this.
Thanks and Regards,
Ravi K Nerella. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 22, 2004 7:17 am Post subject: Re: Setting Message properties ( setStringProperty) |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
ravi.nerella wrote: |
Hi JeffLowrey,
In MQ Console I counldn't find MQRFH2 header itself. I am not sure whether I am looking at correct location or not. I am looking at the Queue.
I am looking at
Console Root---> websphere MQ--->QueueManagers --> under this by selecting particular queue I am viewing its properties. |
That will show you the properties of the queue. What you want to do is choose 'Browse Messages', to show you the messages in the queue. Then select a message, and double-click on it to see the properties for the message. Then look in the data for the property you set.
ravi.nerella wrote: |
In the PDF ,Websphere MQ using Java, in Chapter 12 ( Page 229 ), it is given as
" The MQRFH2 is optional, and its inclusion in an outgoing message is governed by a flag in the JMS Destination class. You can set this flag using the WebSphere MQ JMS administration tool."
Here in Javax.jms API ,I couldn't find any flag. |
The MQRFH2 is optional, but as you see it is only set on the JMS Destination itself. It's not set within the code (unless you are dynamically creating a destination within your code) - it's set in the properties of the destination in the JNDI namespace.
But if you want to pass JMS properties, like you are trying, these are carried in the MQRFH2. So in that case, the header is NOT optional. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ravi.nerella |
Posted: Thu Jan 22, 2004 7:36 am Post subject: Setting Message properties ( setStringProperty) |
|
|
Newbie
Joined: 22 Jan 2004 Posts: 3
|
Hi JeffLowrey,
I am looking at message properties only. In the properites tab, I have
General, Report, context, Identifiers, segmentation and Data tabs.
Under any of these tabs I couldn't find the property.
Under Data tab, I have only the text data that I have sent.
Can you guide on this further..
Thanks and Regards,
Ravi K Nerella. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Jan 22, 2004 8:01 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Try using the amqsbcg program to browse the message. It will read the message and dump it unformatted. You should be able to look at this to see what the MQRFH2 folders have in them in the way of string properties. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Thu Jan 22, 2004 8:27 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
ravi.nerella,
If you want a GUI interactive way of looking at the MQRFH2 values then download and try out MQ Visual Edit. It fully supports MQRFH & MQRFH2 headers.
You can download a 30-trial of MQ Visual Edit at:
http://www.capitalware.biz/products.html
Once you have MQ Visual Edit installed, do the following:
- Connect to the queue manager and open the queue
- Double click on the message (or highlight it and then click Edit->Edit Message from the menu)
- Click the MQRFH2 tab.
- Now you will see the MQRFH2 header in a well formatted panel.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 22, 2004 8:31 am Post subject: Re: Setting Message properties ( setStringProperty) |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
ravi.nerella wrote: |
Under Data tab, I have only the text data that I have sent. |
Then I wonder if your JMS Destination is set to MQSeries, and not to JMS. Like I said, the properties you're trying to set require that you include the MQRFH2 header, which is included in JMS by setting the Destination object to be a JMS destination instead of an MQ destination. _________________ I am *not* the model of the modern major general. |
|
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
|
|
|
|