|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
C API: MQPUT fails with 2010 for large messages |
« View previous topic :: View next topic » |
Author |
Message
|
nberger |
Posted: Tue Apr 30, 2002 1:56 pm Post subject: |
|
|
Newbie
Joined: 08 Jul 2001 Posts: 7
|
We have a C++ application (using MQ's C API) that is trying to place a large (~6 MB) message onto a temporary dynamic queue. The put fails with RC 2010 - data length error.
We have tried the techniques described in the Application Programming Guide for handling large messages at http://www-4.ibm.com/software/ts/mqseries/library/manualsa/csqzal/csqzal2c.htm#HDRHANDL
After increasing the maximum message length on our queue manager, queues, and channels, we were able to send the same message using an application which uses the Java/JMS API. However, the C application still fails with the 2010.
We also tried queue manager segmentation and this didn't seem to change anything. Any ideas?
Thanks in advance. |
|
Back to top |
|
 |
kolban |
Posted: Tue Apr 30, 2002 5:01 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Can you pare down your application to the minimum to illustrate the problem and perhaps post this to this web site? My immediate guess, sustained by it working in Java and not in C is that you did not change the MQMD Version field to be higher than the default (which is minimum). I think this also needs to be changed in order for segmentation to work. |
|
Back to top |
|
 |
nberger |
Posted: Wed May 01, 2002 8:09 am Post subject: |
|
|
Newbie
Joined: 08 Jul 2001 Posts: 7
|
Here's the part of our code that sends the message, but I'm not sure how much it will help. The size of the string response that it fails on is 4227742 characters. It works fine for all smaller messages.
###############################################################################
{
//
// const std::string response is an input parameter
//
//
// Set up message descriptor ...
//
MQMD md = {MQMD_DEFAULT};
// reset MsgId to get a new one
memcpy(md.MsgId, MQMI_NONE, sizeof(md.MsgId) );
// reset CorrelId to get a new one
memcpy(md.CorrelId, MQCI_NONE, sizeof(md.CorrelId) );
// use string format for message
memcpy(md.Format, MQFMT_STRING, sizeof(md.Format));
// these two were just added recently to see if it would make it work,
// but it didn't
md.MsgFlags = MQMF_SEGMENTATION_ALLOWED;
md.Version = MQMD_VERSION_2;
//
// Put the message ...
//
MQLONG CompCode, Reason;
MQPMO pmo = {MQPMO_DEFAULT}; // put message options
MQOD od = {MQOD_DEFAULT};
strncpy(od.ObjectName, m_qName.c_str(), (size_t)MQ_Q_NAME_LENGTH);
MQPUT(m_conn->getConnectionHandle(), // connection handle
m_hObj, // object handle
&md, // message descriptor
&pmo, // default options (datagram)
response.size(), // message length
(void*)response.c_str(), // message buffer
&CompCode, // completion code
&Reason); // reason code
if (Reason != MQRC_NONE)
{
char buff[256];
sprintf(buff,
"MQPUT ended with reason code %ld",
Reason);
CBERR("put", buff);
return false;
}
return true;
}
#############################################################################
This places a messages on the replyToQ specified in an earlier-received message. In this case, the replyToQ is a temporary dynamic queue, but we have the same problem if we make the replyToQ a permanent queue.
Our queue manager, queues (both permanent and model) and channels all have their maximum message length property set to 104853504. |
|
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
|
|
|
|