|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
2026 or MQRC_MD_ERROR on Get |
« View previous topic :: View next topic » |
Author |
Message
|
MikeClark |
Posted: Wed Dec 05, 2007 12:19 pm Post subject: 2026 or MQRC_MD_ERROR on Get |
|
|
 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 |
|
 |
|
|
 |
|
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
|
|
|
|