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 » How can i retrieve jms message from queue using corrlId

Post new topic  Reply to topic
 How can i retrieve jms message from queue using corrlId « View previous topic :: View next topic » 
Author Message
raviseera
PostPosted: Wed Dec 10, 2008 4:34 am    Post subject: How can i retrieve jms message from queue using corrlId Reply with quote

Novice

Joined: 10 Dec 2008
Posts: 10

Our service is now getting MQ messages(Using MDBs and Websphere applicaton server) without defining correlation ID, which means our service simply consume all messages in a MQ queue one-by-one, until the queue is empty. Then, my question is:
Is it possible to support reading MQ messages
with correlation ID? (it should be configrable, so that different beans
can choose whether to use correlation ID or not)
i.e., I want to read the specific message from queue based on Correlation ID. If it is possible then how can i configure this one or what changes i need to made in my application. Please give me your valuable suggestionns on this issue.

It is very very very urgent.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Dec 10, 2008 4:42 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Moved to Java section
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Dec 10, 2008 7:51 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Read the section in the using Java manual about MessageSelector.
Make sure that you define the message selector with the provider type information (JMSCorelId="ID:hexvalueofbytearray") especially if you are below version 7. (Huge performance implications.)

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
raviseera
PostPosted: Wed Dec 10, 2008 9:45 pm    Post subject: Hi Reply with quote

Novice

Joined: 10 Dec 2008
Posts: 10

Thank you very much

But, still i have one question.
Is it best practide to consume JMS message with correlation id? Because, some times correlation id may be null

What is actual meaning of correlation id

Please suggest me with your valuable inputs
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Dec 11, 2008 12:41 am    Post subject: Re: Hi Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

raviseera wrote:
What is actual meaning of correlation id


CorrelId (in Java or other programs) is used to identify one message as connected (having a correlation with another. Most typically it's used to identify a reply to a request; an application will make a request & will identify it's reply from the available replies by selecting the one with "it's" request id in the correl id.

This is explained, in slightly better English and with diagrams, in the Intercommunication manual.

As to if it's best practice, it's one of the 2 ways to recieve a reply. The other is with temporary dynamic queues. Which is best is a design decision you must make locally. Both methods have pros and cons. The search feature will turn up some possibly useful debates on the forum.


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
raviseera
PostPosted: Thu Dec 11, 2008 12:48 am    Post subject: Message Selector problem Reply with quote

Novice

Joined: 10 Dec 2008
Posts: 10

Thank you Very much,

I have one more doubt.

Can i consume the message from MQ with particular field.

Ex: <Even CampaignName = "Ravi"></Event>

Is it possible to consume the message with CampaignName="Ravi"

Please help me on this one
Back to top
View user's profile Send private message
atheek
PostPosted: Thu Dec 11, 2008 2:17 pm    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

Yes you can do that. You can set up the selectors in some special headers in the message called RF Headers. Read using java guide to understand how to do this.

However, performance wise I think this is not that much recommended.
Back to top
View user's profile Send private message
raviseera
PostPosted: Thu Dec 11, 2008 9:28 pm    Post subject: Reply with quote

Novice

Joined: 10 Dec 2008
Posts: 10

Can u expain on this one

Performance wise, why it is not recommended


Your valuable suggestions and inputs are very helpful for me
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Dec 12, 2008 12:27 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

raviseera wrote:
Performance wise, why it is not recommended


Because a queue manager is not a database. Put simply and to continue the database analogy, to read like this requires the queue manager to do a "tablescan" down the queue. Any DBA on any database platform will tell you this is an inefficient and resource hungry activity.

A lot depends here on how deep you think your queue will be. You'll find (again simplistically) that performance will degrade exponentially as the queue depth increases.

A queue manager is designed to deliver messages. It's good at it. A database is designed to find information based on key values. It's good at it. 2 different software solutions for 2 different problems.

Hope that helps.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » How can i retrieve jms message from queue using corrlId
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.