ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Setting and Getting the JMS Message ID's

Post new topic  Reply to topic
 Setting and Getting the JMS Message ID's « View previous topic :: View next topic » 
Author Message
ganesh3
PostPosted: Thu May 04, 2006 1:04 am    Post subject: Setting and Getting the JMS Message ID's Reply with quote

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
View user's profile Send private message Yahoo Messenger
elvis_gn
PostPosted: Thu May 04, 2006 1:23 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
ganesh3
PostPosted: Thu May 04, 2006 1:38 am    Post subject: Getting and setting the values Reply with quote

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
View user's profile Send private message Yahoo Messenger
elvis_gn
PostPosted: Thu May 04, 2006 2:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
vennela
PostPosted: Thu May 04, 2006 4:49 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Request Reply paradigm explained by Brandon here
http://www.mqseries.net/phpBB2/viewtopic.php?t=3759&highlight=paradigm

I have not used JMS MessageIds and JMSCorrelIds but if it is all the way JMS - both the sender and rcvr, then it is OK. If you try to mix and match then it is a pain.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
briancop
PostPosted: Thu May 04, 2006 8:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Setting and Getting the JMS Message ID's
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.