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 API Support » 2026 or MQRC_MD_ERROR on Get

Post new topic  Reply to topic
 2026 or MQRC_MD_ERROR on Get « View previous topic :: View next topic » 
Author Message
MikeClark
PostPosted: Wed Dec 05, 2007 12:19 pm    Post subject: 2026 or MQRC_MD_ERROR on Get Reply with quote

Apprentice

Joined: 17 Feb 2004
Posts: 27
Location: Olympia, WA

This isn't a request for help, but I messed up and kept getting a 2026 on the Get from a queue, and it took me a while to figure out what the problem was. I've done this before, but had forgotten precisely what the solution was. If it happens that someone else runs into this and comes here for help, well, I have a suggestion!

Anyway, in C# code I declared an instance of an MQMessage and left its value null in the declaration. Much later down in the code after opening to the queue manager and accessing the queue I performed a Get and kept getting a 2026. A few hours later and consultation with manuals, user groups and so on I finally figured it out. Again.

When doing the Get the MQMessage it was supposed to be using to put the message into was not instantiated, but it was a null object. Of course this meant that the Message Description was messed up!

You need to instantiate the MQMessage before using it in the Get or else you get a 2026. See the code below:

Code:

MQQueue mqQ = mqQMgr.AccessQueue(QName,
        MQC.MQOO_FAIL_IF_QUIESCING
        + MQC.MQOO_INPUT_AS_Q_DEF
        + MQC.MQOO_SET);

MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.WaitInterval = 500;
gmo.Options =
    MQC.MQGMO_CONVERT +
    MQC.MQGMO_ACCEPT_TRUNCATED_MSG;

MQMessage mqMsg = new MQMessage();
mqQ.Get(mqMsg, gmo);


So make sure you have instantiated the MQMessage before using it in a Get!
_________________
"...a long habit of not thinking a thing wrong, gives it a superficial appearance of being right..." [Tom Paine]
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » 2026 or MQRC_MD_ERROR on Get
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.