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 » Wild Card search using correlation Id

Post new topic  Reply to topic
 Wild Card search using correlation Id « View previous topic :: View next topic » 
Author Message
ksrini
PostPosted: Tue Dec 24, 2013 11:06 pm    Post subject: Wild Card search using correlation Id Reply with quote

Newbie

Joined: 24 Dec 2013
Posts: 3

Hi,

I am trying to retrieve messages from Queue based on pattern in correlation ID value. It is not accepting wild card search, message is retrieved only if value is fully matched.

correlation id value in message : SIT

mqmessage.correlationid="SIT".getBytes()
getMessage() - message is fetched

correlation id value in message : SIT123

mqmessage.correlationid="SIT*".getBytes()
getMessage() - message is not fetched.

In below link, its mentioned to set use wild card property to Yes. but not mentioned on which object this needs to be set.

http://pic.dhe.ibm.com/infocenter/iisinfsv/v8r1/index.jsp?topic=/com.ibm.swg.im.iis.conn.wsmq.help.doc/topics/r_cwsmqcon_cn_Value_for_Correlation_id.html

I am using MQ Java classes and not JMS. Please clarify.


Thanks
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Dec 25, 2013 1:53 am    Post subject: Reply with quote

Grand High Poobah

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

Seems to me you need to stop doing selective reading:
Quote:
For output links only, you can use an asterisk (*) as a wildcard character to represent contiguous characters if you set Use wildcard to Yes.

You can use only one wildcard character per property value. If you use more than one wildcard character, only the first usage is interpreted as a wildcard. All subsequent usages are interpreted as actual values, not as wildcard values.

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
ksrini
PostPosted: Wed Dec 25, 2013 2:19 am    Post subject: Reply with quote

Newbie

Joined: 24 Dec 2013
Posts: 3

fjb_saper wrote:
Seems to me you need to stop doing selective reading:
Quote:
For output links only, you can use an asterisk (*) as a wildcard character to represent contiguous characters if you set Use wildcard to Yes.

You can use only one wildcard character per property value. If you use more than one wildcard character, only the first usage is interpreted as a wildcard. All subsequent usages are interpreted as actual values, not as wildcard values.


Is there any other way to pick messages selectively other than this option?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Dec 26, 2013 7:27 am    Post subject: Reply with quote

Grand High Poobah

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

ksrini wrote:
fjb_saper wrote:
Seems to me you need to stop doing selective reading:
Quote:
For output links only, you can use an asterisk (*) as a wildcard character to represent contiguous characters if you set Use wildcard to Yes.

You can use only one wildcard character per property value. If you use more than one wildcard character, only the first usage is interpreted as a wildcard. All subsequent usages are interpreted as actual values, not as wildcard values.


Is there any other way to pick messages selectively other than this option?

Output only means you cannot pick a message selectively using this option!

What you should do is read back the correl info after the put and then apply the exact info for reading.

If you need to read / select with partial info, I believe you can do that using JMS Selectors.... be aware however that there is a severe performance penalty attached to picking the messages with partial correlid vs full correlid....

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
ksrini
PostPosted: Fri Dec 27, 2013 10:16 pm    Post subject: Reply with quote

Newbie

Joined: 24 Dec 2013
Posts: 3

fjb_saper wrote:
ksrini wrote:
fjb_saper wrote:
Seems to me you need to stop doing selective reading:
Quote:
For output links only, you can use an asterisk (*) as a wildcard character to represent contiguous characters if you set Use wildcard to Yes.

You can use only one wildcard character per property value. If you use more than one wildcard character, only the first usage is interpreted as a wildcard. All subsequent usages are interpreted as actual values, not as wildcard values.


Is there any other way to pick messages selectively other than this option?

Output only means you cannot pick a message selectively using this option!

What you should do is read back the correl info after the put and then apply the exact info for reading.

If you need to read / select with partial info, I believe you can do that using JMS Selectors.... be aware however that there is a severe performance penalty attached to picking the messages with partial correlid vs full correlid....

Have fun


I tried posting message with MQ Java API, assigning correlation id value say "UAT_12345". I read the message with MQ JMS classes by giving JMS selector as "JMSCORRELATIONID LIKE 'ID:554154%'. Its picking the message now.

554154 - Hex of string "UAT"

I will check for performance impact as well. Thanks for your response.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Mon Dec 30, 2013 7:05 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

ksrini wrote:
I will check for performance impact as well. Thanks for your response.


Make sure you load the queue up with a few hundred dummy messages, then your real message. Then do the performance test to see how long it takes before your app receives the message it wants using this method.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Dec 30, 2013 7:07 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Make sure you consider the security implications of putting messages for a UAT environment into the same queue as messages for a SIT environment.
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 » Wild Card search using 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.