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 » Problem with getting messages from the que

Post new topic  Reply to topic
 Problem with getting messages from the que « View previous topic :: View next topic » 
Author Message
HaseebJunaid
PostPosted: Fri Aug 24, 2001 5:57 am    Post subject: Reply with quote

Newbie

Joined: 22 Aug 2001
Posts: 6
Location: Michigan

I am using the IBM sample program amqsget to get messages from a queue. However, it keeps coming back with the reason code of 2080 "Truncated message failed". What could be the problem? Any help is greatly appreciated.

I also like the idea of a single forum for third party tools
Back to top
View user's profile Send private message
ChrisW
PostPosted: Fri Aug 24, 2001 7:54 am    Post subject: Reply with quote

Voyager

Joined: 20 May 2001
Posts: 78
Location: UK

The message is larger than the program allows for.

Try amqsbcg instead to browse the messages.
Back to top
View user's profile Send private message Send e-mail
bduncan
PostPosted: Fri Aug 24, 2001 10:07 am    Post subject: Reply with quote

Padawan

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

amqsbcg also has a pathetically smaller buffer size. The best solution is to recompile the sample programs providing a larger buffer size...
To explain, when getting a message from MQSeries, you need to specify a buffer size to allocate to pull off the message. It does NOT dynamically resize to hold the whole message. In other words, if there is a 2000 byte message on the queue, and I call MQGET but only supply a 1024 byte buffer, the get will fail with a truncation error. However, if I specify the MQGET option ACCEPT_TRUNCATED_MESSAGES, the MQGET will succeed, but you will only get the first 1024 bytes of the 2000 byte message. The rest will be truncated. The sample programs all have buffer sizes below 100K (but that's just a ballpark guess) - you will need to recompile them with larger buffers if you need to deal with bigger messages...


_________________
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
HaseebJunaid
PostPosted: Fri Aug 24, 2001 12:13 pm    Post subject: Reply with quote

Newbie

Joined: 22 Aug 2001
Posts: 6
Location: Michigan

Thanx for your guys replies. Where do I specify the buffer size?
Back to top
View user's profile Send private message
kolban
PostPosted: Fri Aug 24, 2001 6:37 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

On the MQGET API call, one of the parameters is the size of the buffer that you are supplying into which the retrieved message will be saved. Look at the code and I think you'll find that this is the length of the fixed length array.

Personally, I like using the OO classes (C++, Java, COM) which dynamically allocate buffers sufficiently large for the message being read. This may required two gets ... one to determine buffer size and the second to actually retrieve the message with the now correctly sized buffer.
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 » Problem with getting messages from the que
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.