|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Problem with getting messages from the que |
« View previous topic :: View next topic » |
Author |
Message
|
HaseebJunaid |
Posted: Fri Aug 24, 2001 5:57 am Post subject: |
|
|
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 |
|
 |
ChrisW |
Posted: Fri Aug 24, 2001 7:54 am Post subject: |
|
|
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 |
|
 |
bduncan |
Posted: Fri Aug 24, 2001 10:07 am Post subject: |
|
|
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 |
|
 |
HaseebJunaid |
Posted: Fri Aug 24, 2001 12:13 pm Post subject: |
|
|
Newbie
Joined: 22 Aug 2001 Posts: 6 Location: Michigan
|
Thanx for your guys replies. Where do I specify the buffer size? |
|
Back to top |
|
 |
kolban |
Posted: Fri Aug 24, 2001 6:37 pm Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
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
|
|
|
|