Size negotiated for the client channel

Asked by Adri Townsend

I guess this is actually a question for IBM, but you might help me as I'm using pymqi :)

I get a MQRC_DATA_LENGTH_ERROR when the buffer size is set big enough to handle the message.

IBM reason codes says that this happens if the BufferLength parameter exceeds the maximum message size that was negotiated for the client channel.

Where is this "message size that was negotiated for the client channel" set?

I specify the server channel when I connect, and the maxmsgl of this server channel more than big enough for the message. What else do I need to set for this to work?

Question information

Language:
English Edit question
Status:
Solved
For:
PyMQI Edit question
Assignee:
No assignee Edit question
Solved by:
Dariusz Suchojad
Solved:
Last query:
Last reply:
Revision history for this message
Dariusz Suchojad (dsuch) said :
#1

I have no idea, really. Asking IBM would be the safest bet because Infocenter doesn't seem to have too much info on that. From IBM's support point of view, PyMQI should be simply a C program since it uses C API underneath. Don't forget to come back and let everyone know what it was though!

Revision history for this message
Adri Townsend (adri-townsend) said :
#2

Can you tell me how to set up the MQCD referred to in the MQCNO structure with a MaxMsgLength? That MaxMsgLength might solve my problem...

I've got a python example, just need to do this with pymqi:

$mqcno = array(
   'Version' => MQSERIES_MQCNO_VERSION_2,
   'Options' => MQSERIES_MQCNO_STANDARD_BINDING,
   'MQCD' => array(
    'ChannelName' => $this->MQChannelName,
    'ConnectionName' => $this->MQHost,
    'TransportType' => MQSERIES_MQXPT_TCP,
                                'MaxMsgLength ' => 9595093

   ),
  );

  mqseries_connx($this->MQManager, $mqcno, $this->conn, $comp_code, $reason);

Revision history for this message
Best Dariusz Suchojad (dsuch) said :
#3

Hi, I'm not sure what programming language your example is in (Perl maybe?) but here's how it would look like in Python. I've actually taken it from http://packages.python.org/pymqi/examples.html#how-to-correlate-request-and-response-messages-using-correlationid which shows how to use construct an MQCD structure. Do you think the example wasn't clear enough? Can it be improved somehow? Cheers!

import pymqi
import CMQC, CMQXC

queue_manager = "QM01"
channel = "SVRCONN.1"
host = "192.168.1.139"
port = "1434"
queue_name = "TEST.1"
message = "Hello from Python!" * 10000
conn_info = "%s(%s)" % (host, port)

cd = pymqi.CD()

cd.MaxMsgLength = 9595093

cd.ChannelName = channel
cd.ConnectionName = conn_info
cd.ChannelType = CMQC.MQCHT_CLNTCONN
cd.TransportType = CMQC.MQXPT_TCP

qmgr = pymqi.QueueManager(None)
qmgr.connect_with_options(queue_manager, cd=cd)

queue = pymqi.Queue(qmgr, queue_name)
queue.put(message)
queue.close()

qmgr.disconnect()

Revision history for this message
Adri Townsend (adri-townsend) said :
#4

YOU ARE OFFICIALLY MY HERO!!! :)

Revision history for this message
Adri Townsend (adri-townsend) said :
#5

Oh, and to be honest, I could not find an example, obviously I did not search on the right words.

Revision history for this message
Dariusz Suchojad (dsuch) said :
#6

Heh, thanks.

It could be my fault as well, the usage examples more or less assume you know at least a little bit about the thing you're looking for. In this particular case, one needs to know that PyMQI exposes all MQ constants without the MQ- prefix so that MQCD becomes CD, MQMD is MD etc. So that looking for CD would bring up the result. Not sure if that's a sane assumption.. Be always sure to drop by In case you think anything could be improved.

Cheers!