|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Message selector using wildcards with byte strings |
« View previous topic :: View next topic » |
Author |
Message
|
bcarlson |
Posted: Fri May 21, 2010 8:43 am Post subject: Message selector using wildcards with byte strings |
|
|
Newbie
Joined: 21 May 2010 Posts: 2
|
We have a customer that has given us a request to search for a segment of the correlation ID. I have found the simple solutions for equals and not equals, which are working great. However, is there a way to search for a substring on a byte value in a message selector?
More specifics:
The customer is using the correlation ID to store multiple values. The receiving system only cares what one value is. For example, if the correlation ID is:
01-AD46-FE83-7890-DB5F-0000000000000000000000000000000
They would like to be able to check that the sixth and seventh bytes are "0x7890", without caring about the rest of the data. Note that they are OK with simply doing a wildcard search for the bytes "0x7890" within the value.
However, in a typical string, we are doing a query such as "sport like '%ball%' to get 'football', 'basketball', 'baseball', etc. (obviously not our real data), but I have combed the web high and low looking for a way to do this with byte data instead of string data.
So, the questions are:
- Is the LIKE operator supported with byte data?
- Is there a way to specify wildcards with byte data?
- Is there some other solution that I'm completely overlooking here for setting a selector on a substring of a byte string?
Thanks for your help!
-=b=- |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 21, 2010 8:54 am Post subject: Re: Message selector using wildcards with byte strings |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bcarlson wrote: |
The customer is using the correlation ID to store multiple values. |
They shouldn't be. The correl id is for identifying messages and while it can be argued that you're "identifying" a message, you're doing it via business data. There are much better places to hold this sort of thing.
Note also that, as it's a byte array, values will change as your code crosses code pages. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
wschutz |
Posted: Fri May 21, 2010 10:00 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
I'm trying to understand what you want to do here. Are you saying that in a queue there might be any different number of messages, with different CorrelIds and data, and you're happy to get any one of them based on a segment of the CorellId? Can't the application that generates the CorrelID just make all the CorrelIds the same? Or is this some application that really wants to use Message Groups? _________________ -wayne |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri May 21, 2010 11:47 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If you can't change the design (my preferred approach) you should try this.
Accept all messages and move them into 2 queues / buckets
bucket 1 correlationId and bitewise your value
bucket 2 failed litmus test
This will potentially be way faster than any scanning of the correlation Id.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bcarlson |
Posted: Tue May 25, 2010 7:49 am Post subject: |
|
|
Newbie
Joined: 21 May 2010 Posts: 2
|
Apologies for taking so long to follow up, but I wanted to send a little note to say that we have decided to go forward with this solution. Thanks for your help, everyone!
fjb_saper wrote: |
If you can't change the design (my preferred approach) you should try this.
Accept all messages and move them into 2 queues / buckets
bucket 1 correlationId and bitewise your value
bucket 2 failed litmus test
This will potentially be way faster than any scanning of the correlation Id.
Have fun  |
|
|
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
|
|
|
|