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 » MQ Correlation ID vs JMS Correlation ID

Post new topic  Reply to topic
 MQ Correlation ID vs JMS Correlation ID « View previous topic :: View next topic » 
Author Message
kutulu2000
PostPosted: Wed Oct 31, 2007 8:34 am    Post subject: MQ Correlation ID vs JMS Correlation ID Reply with quote

Acolyte

Joined: 08 Nov 2005
Posts: 63
Location: Mexico

Hi all,

We are starting to develop an application implementing SOA. This aplication is server side and the tier to connect to a queue resource must be a MDB 3.0 spec.

The client application creates messages usig the mq api and sends to a mq queue. The client application puts in the message a correlation ID indicating that the target is our server side application.

What we are trying to do is to filter the messages by correlation ID and the MDB must "catch" only the messages whose correlation ID is "MDB" (for example). Since the message is sending using MQ (MQMessage) and the MDB expects (or uses) a jms Message we can't obtain the correlation ID directly.

Someone who can guide us with this topic? I'm newbie in jms and any idea would be appreciated.

Thanxxx!!!
_________________
#10
Back to top
View user's profile Send private message Send e-mail MSN Messenger
jefflowrey
PostPosted: Wed Oct 31, 2007 9:46 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Please don't use CorrelationID for this kind of filtering. In general, please don't share queues between logically unrelated functions. If the MDB only needs to receive messages that "belong" to it, then give it it's own queue, and only PUT messages that "belong" to the MDB on that queue.

In particular, under JMS, it will perform badly (i.e., no better than filtering on any other JMS Property) unless you use a very specific match for the bytes of the CorrelationID string.

And, yes, the JMS API does allow you to access the JMSCorrelationID, which the MQ JMS Provider does ensure is the same as the MQMD.CorrelID.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Oct 31, 2007 1:51 pm    Post subject: Reply with quote

Grand High Poobah

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

jefflowry wrote:
And, yes, the JMS API does allow you to access the JMSCorrelationID, which the MQ JMS Provider does ensure is the same as the MQMD.CorrelID.


I believe this applies only for a JMSCorrelationId <= 24 bytes.
If the correlationId is more than 24 bytes (48 +3 in the provider string hex representation of the array 'ID:xxxx') MQ truncates the correlation Id @ 24 bytes and this is what is being put to the MQMD... although the full correlationId is kept in the RFH2.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
bower5932
PostPosted: Wed Oct 31, 2007 2:04 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

There is a program (CorrelExample.java) at:

http://www.developer.ibm.com/tech/sampmq.html

that manipulates message id's and correlation id's that you might want to look at.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
mvic
PostPosted: Wed Oct 31, 2007 2:59 pm    Post subject: Re: MQ Correlation ID vs JMS Correlation ID Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

kutulu2000 wrote:
What we are trying to do is to filter the messages by correlation ID and the MDB must "catch" only the messages whose correlation ID is "MDB" (for example). Since the message is sending using MQ (MQMessage) and the MDB expects (or uses) a jms Message we can't obtain the correlation ID directly.

With the help of Google I found the following, which might help:
- http://www.ibm.com/jct09002c/isv/tech/sample_code/mq/CorrelExample.java
- http://www.ibm.com/developerworks/websphere/techjournal/0301_wosnick/wosnick.html
- http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaw.doc/uj26720_.htm
Back to top
View user's profile Send private message
kutulu2000
PostPosted: Wed Oct 31, 2007 3:13 pm    Post subject: Reply with quote

Acolyte

Joined: 08 Nov 2005
Posts: 63
Location: Mexico

I'm very grateful with all of you. I'm reading and analyzing the proposals.
Soon I'll post any new idea to this.


_________________
#10
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQ Correlation ID vs JMS Correlation ID
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.