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 » General Discussion » MQGET Error

Post new topic  Reply to topic
 MQGET Error « View previous topic :: View next topic » 
Author Message
asutoshch
PostPosted: Wed Jul 14, 2004 4:54 am    Post subject: MQGET Error Reply with quote

Newbie

Joined: 14 Jul 2004
Posts: 3
Location: India

Hi, I am developing a small piece of code in C to retrieve messages from an MQ Queue. I did MQCONN, MQOPEN successfully and then on MQGET, it returns failure with reason code = 2079 when I mention MQGMO_ACCEPT_TRUNCATED_MSG in gmo.Options. Otherwise it returns 2080. In any case, it does not solve my purpose. I want to retrieve all messages successfully. The buffer size is made enough (1MB) to hold the message. Also I can see the message length retrieved is below 1000. The retrieved message, when I use printf, shows only first 3 characters.
Someone told me to use useEmptyBuffer(). But again I could not follow why to use that and also it is available when using C++ only (Not C).
Can someone help me in resolving this issue ? I am not able follow.
Thanks
AC
Back to top
View user's profile Send private message Yahoo Messenger
JasonE
PostPosted: Wed Jul 14, 2004 5:22 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

What are you putting in the 5th parm to MQGET - That specifies the size of the buffer provided. The size used is returned from the 7th parm to MQGET.
Back to top
View user's profile Send private message
asutoshch
PostPosted: Wed Jul 14, 2004 5:32 am    Post subject: Reply with quote

Newbie

Joined: 14 Jul 2004
Posts: 3
Location: India

The 5th parameter is the bufferlength=1000000 and the 7th parameter returns the size of actual message retrieved. It shows some value below 1000. I am using the value of 5th parameter to allocate memory for the 6th parameter buffer to hold the message. I guess the the 5th parameter can be more than the actual size of the messages.
Back to top
View user's profile Send private message Yahoo Messenger
JasonE
PostPosted: Wed Jul 14, 2004 5:46 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

That sounds ok. If you amqsbcg the queue file, and look at message 1, what is its data length?

Try taking a trace, formatting it (if non-windows), finding the trace file for the C application (look at the header, its obvious...) and find the two sections:

MQGET >> is entry to MQGET


MQGET << is exit from MQGET

What does it say the parms are?
Back to top
View user's profile Send private message
gunter
PostPosted: Wed Jul 14, 2004 6:21 am    Post subject: Reply with quote

Partisan

Joined: 21 Jan 2004
Posts: 307
Location: Germany, Frankfurt

What os are you using? Maybe I can help if you post the code and a short description of the message.
_________________
Gunter Jeschawitz
IBM Certified System Administrator - Websphere MQ, 5.3
Back to top
View user's profile Send private message
asutoshch
PostPosted: Wed Jul 14, 2004 9:05 pm    Post subject: Reply with quote

Newbie

Joined: 14 Jul 2004
Posts: 3
Location: India

I could not follow it properly. Do you want me to store the read buffer into a file and then check the contents? Thanks for your help.
Asutosh
Back to top
View user's profile Send private message Yahoo Messenger
JasonE
PostPosted: Thu Jul 15, 2004 1:07 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

I've sent you a PM. Also, what platform, release and fixpack/csd are you using?
Back to top
View user's profile Send private message
silentflute
PostPosted: Thu Jul 15, 2004 4:05 am    Post subject: MQGET Error Reply with quote

Apprentice

Joined: 14 Jul 2004
Posts: 32

You could use the WMQ sampe program 'amqsget' as a sample to model your C program after.

HTH
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » MQGET Error
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.