|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Setting and Getting the JMS Message ID's |
« View previous topic :: View next topic » |
Author |
Message
|
ganesh3 |
Posted: Thu May 04, 2006 1:04 am Post subject: Setting and Getting the JMS Message ID's |
|
|
Apprentice
Joined: 30 Mar 2006 Posts: 35
|
Hi,
I would like to know if i need to set the message id specificallyor the MQ sets the same. If the MQ sets the same then how can i check for the same when I recieve the message. Can I use the
createReceiver(Queue queue, java.lang.String messageSelector) ?
How can I use the same?
Say without setting the JMS message id , i try to get the same, what value will i get? kindly let me know. _________________ Have a Good Day!!! |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu May 04, 2006 1:23 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi ganesh3,
Quote: |
what value will i get? |
the same
Sorry, just kidding...
The message Id is set by MQ, you dont need to code it, and its unique everytime....I am hoping that you were asking about the message Id which is there in all MQ messages, irrespective of its being JMS....
You can pick the message id using the API's, should be some message.messageid or something(not sure about the JMS APIs)...u can always look it up.
About what a message id looks like, search this forum, you'll find many examples.
Regards. |
|
Back to top |
|
 |
ganesh3 |
Posted: Thu May 04, 2006 1:38 am Post subject: Getting and setting the values |
|
|
Apprentice
Joined: 30 Mar 2006 Posts: 35
|
Hi,
Thanks for the reply. I think in java we can set the Message ID's using the setMessageID() method of Message Object. I am using a request reply queue. So when i send a message will the MEssage Id be generated automatically or do i need to set it? When i am retrieving the reply message i need to check that i am getting the message for the same message id i had sent along with the request. So if i use the method createReciever(queue, messageselector), what should the message selector be? JMSCorrelationID or JMSMessageID. _________________ Have a Good Day!!! |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu May 04, 2006 2:33 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi ganesh3,
Let MQ generate the Message ID...
Send your request...store the Message Id to the Correlation ID...
On getting the reply, verify that the id in the correlation field is the same as the one u sent...(ofcourse you will have to ask the reply side to save that)..there are some other ways too...try a search on the forum.
Regards. |
|
Back to top |
|
 |
vennela |
Posted: Thu May 04, 2006 4:49 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
|
Back to top |
|
 |
briancop |
Posted: Thu May 04, 2006 8:17 am Post subject: |
|
|
 Apprentice
Joined: 04 Apr 2005 Posts: 28 Location: Hursley, UK
|
The JMS API lets you set certain fields of a message, including message id, which wll be overwritten by the JMS provider (in this case MQ) when the message is sent, so there is little point in ever setting a message id yourself - let MQ set it when you send the message and you can retrieve it and use it as you describe.
Brian |
|
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
|
|
|
|