|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQGETting particular messages - Cade Hewitt |
« View previous topic :: View next topic » |
Author |
Message
|
bduncan |
Posted: Wed Jun 06, 2001 11:07 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
On Thu, 7 Jun 2001, Cade Hewitt wrote:
> Hello,
> I have two questions.
>
> 1) We have an application that wants to use a field in the MQMD to put its own
> identifier. Which field would be best for this purpose?
>
> 2) What criteria are you able to do a search on the queue when you are doing a
> get?
>
>
> Thanks in advance for your help.
>
> Cade Hewitt
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
bduncan |
Posted: Wed Jun 06, 2001 11:17 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Cade,
We typically use the MsgType field, though you can also use the MsgId or CorrelId fields. Just keep in mind that if you override the MsgId field (which normally gets set to a unique number by MQSeries) and you don't guarantee uniqueness, you may end up with two messages in the system with the same MsgId which can cause problems. CorrellId may be a better choice than MsgType if you need to have a very long identifier - I believe MsgType only 8 bytes whereas CorrellId is 24.
You can search on several criteria. The ones I have listed all work: MsgId, CorrellId, MsgType. In addition you can match against GroupId, MsgSeqNumber, MsgToken, and Offset. Keep in mind that if you are matching against, say CorrellId, and you do a GET that succeeds, the other matching fields like MsgId will be set to the values that were in the message. This means that if you do another GET using the same MQMD structure that you did the original GET all those values will still be set and you will end up trying to match against a message that is no longer on the queue. This means that when you are doing multiple MQGETs and matching against some value, you need to reset all matchable values in the MQMD structure after each GET.
Hope this helps...
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
Galichet |
Posted: Wed Jun 27, 2001 12:17 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 69 Location: Paris - France
|
Cade,
You must have in mind that MsgId and CorrelId are not converted by MQSeries, eg if you filled one of those field with a string value from an EBCDIC machine, this value still in EBCDIC format on an ASCII machine...
_________________ Eric Galichet
SMABTP
France |
|
Back to top |
|
 |
stella |
Posted: Mon Jul 02, 2001 10:44 am Post subject: |
|
|
Newbie
Joined: 01 Jul 2001 Posts: 1 Location: IBM Argentina
|
I've seen the questions about MQGetting a specific message, say using the MSGID. Now, I'm wondering if someone could send me sample java code or c code (java preferred) on how to do this (puts and gets with specific msgid's )
Thanks! Stella. |
|
Back to top |
|
 |
bduncan |
Posted: Thu Aug 23, 2001 4:27 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
|
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
|
|
|
|