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 IndexIBM MQ API SupportMQGETting particular messages - Cade Hewitt

Post new topicReply to topic
MQGETting particular messages - Cade Hewitt View previous topic :: View next topic
Author Message
bduncan
PostPosted: Wed Jun 06, 2001 11:07 pm Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
bduncan
PostPosted: Wed Jun 06, 2001 11:17 pm Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Galichet
PostPosted: Wed Jun 27, 2001 12:17 am Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
stella
PostPosted: Mon Jul 02, 2001 10:44 am Post subject: Reply with quote

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
View user's profile Send private message
bduncan
PostPosted: Thu Aug 23, 2001 4:27 pm Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

Stella,
Sorry it's taken so long to respond to your question, but here is a link to a sample java program in the http://www.mqseries.net software repository that shows how to use MQGET and MsgIds:
http://www.mqseries.net/pafiledb203/pafiledb.php?action=viewfile&fid=28&id=3


_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ API SupportMQGETting particular messages - Cade Hewitt
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.