|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
automatic buffer limit |
« View previous topic :: View next topic » |
Author |
Message
|
hdjur |
Posted: Mon Jan 23, 2006 8:19 am Post subject: automatic buffer limit |
|
|
Centurion
Joined: 16 Sep 2004 Posts: 116 Location: Zagreb
|
Hello!
I'm facing a 2 kb limit when using automatic buffer feature in C++ applications, during get operation.
The only way I am aware of, to avoid this limit, is not to use this feature.
I usually do this : browse message, allocate buffer of totalMessageLength size, assign buffer to a message with useEmptyBuffer and then get message.
How can I set this limit to a higher value, or avoid it in some more appropriate way?
Thanks!
Last edited by hdjur on Tue Jan 24, 2006 2:19 am; edited 1 time in total |
|
Back to top |
|
 |
mvic |
Posted: Mon Jan 23, 2006 9:42 am Post subject: Re: automatic buffer limit |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
hdjur wrote: |
I'm facing a 2 kb limit when using automatic buffer feature in C++ applications |
Please would you post some sample code, so we can see exactly what you are doing? Thanks |
|
Back to top |
|
 |
hdjur |
Posted: Tue Jan 24, 2006 12:58 am Post subject: |
|
|
Centurion
Joined: 16 Sep 2004 Posts: 116 Location: Zagreb
|
Sample code:
ImqQueue repQueue ;
repQueue.setName("ABC");
repQueue.setConnectionReference(manager);
repQueue.setOpenOptions(MQOO_INPUT_SHARED | MQOO_INQUIRE);
if (!repQueue.open( ) ) {
log_("queue open failed with reason code: ",repQueue.reasonCode());
exit(0);
}
ImqGetMessageOptions gmo;
gmo.setWaitInterval( MQWI_UNLIMITED);
gmo.setOptions( MQGMO_WAIT | MQGMO_FAIL_IF_QUIESCING | MQGMO_ACCEPT_TRUNCATED_MSG);
ImqMessage * repMess = new ImqMessage();
repMess->setMessageId( );
repMess->setCorrelationId( );
if (!repQueue.get(* repMess, gmo)) {
log_("get message failed, reason code: ",repQueue.reasonCode());
exit(0);
}
cout << "repMess->totalMessageLength():" << repMess->totalMessageLength() << endl;
cout << "strlen(repMess->bufferPointer()):" << strlen(repMess->bufferPointer()) << endl;
cout << "strlen(repMess->dataPointer()):" << strlen(repMess->dataPointer()) << endl;
If totalMessageLength is greater than 2048 bytes, the other two numbers are exactly 2048. Otherwise, all three numbers are equal.
Is there any way to use automatic buffer without this limit?
Thanks. |
|
Back to top |
|
 |
mvic |
Posted: Tue Jan 24, 2006 2:25 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
hdjur wrote: |
If totalMessageLength is greater than 2048 bytes, the other two numbers are exactly 2048. Otherwise, all three numbers are equal.
Is there any way to use automatic buffer without this limit? |
I think the limit might be used by the MQ C++ API because you've specifed MQGMO_ACCEPT_TRUNCATED_MSG in the options for the get.
This flag is telling the API that you are willing to accept partial contents of a message. I imagine the MQ C++ API is supplying a 2048 byte buffer on its MQGET calls, and since you have specified MQGMO_ACCEPT_TRUNCATED_MSG, it does not expand the buffer, but returns to your program with just the 2048.
What happens if you remove that flag from the options? |
|
Back to top |
|
 |
hdjur |
Posted: Tue Jan 24, 2006 2:59 am Post subject: |
|
|
Centurion
Joined: 16 Sep 2004 Posts: 116 Location: Zagreb
|
Thank you mvic, you are completely right!
I was expecting to have MQRC_TRUNCATED_MSG_FAILED reason code in that case, instead of that, it completely solved my problem, message was not truncated.
How silly of me I didn't try it by myself.
Bye |
|
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
|
|
|
|