Override message/buffer length

Asked by Rayno van Zyl

Can one set or override the message/buffer length on a PUT as when using IBM supported languages (Cobol, C, Assembler, ...)

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
Best Dariusz Suchojad (dsuch) said :
#1

Hi Rayno,

PyMQI is a library for connecting to WebSphere MQ from programs written in the Python programming language. It's an open source project not affiliated with IBM, IBM isn't sponsoring it and doesn't provide any official support.

So it isn't exactly the best place to ask questions about IBM-supported languages such as COBOL, C or Assembler.

That said, PyMQI happens to be written in both Python and C so I do know the MQ's C API.

Even then, I don't really understand the question, on invoking MQPUT it is a user-defined buffer that's being passed into the call. So you are in a total control of its length, I just can't see anything that would need overriding.

Cheers!

Revision history for this message
Rayno van Zyl (rayno) said :
#2

Thanks for the feedback and I apologies for not explaining myself better. Lets try and explain it as follows:
...
queue = pymqi.Queue(qmgr, queue_name)
message = 100*1024*1024*"z"
print("Message length = ", len(message))
queue.put(message)
...
In the above snippet of code, is there any way of overriding the message length (in this case 100MB) to something smaller and not change code line [message = 100*1024*1024*"z"] ?

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

Ah, I see.

So the question now is, what purpose should it serve? Is it because in your code you're given a message, say, a 100 MB of size, and don't want to send it all in one go?

I'd rather understand it before giving any advice because taken literally, what you're asking about goes strictly against the grain, the user of C API - PyMQI in that case - is supposed to provide MQ with a buffer and its length hence PyMQI - being written in Python - allows its users - you in that case - to provide the buffer only and computes the length itself before passing it into C MQ layer.

Revision history for this message
Rayno van Zyl (rayno) said :
#4

Thanks Dariusz Suchojad, that solved my question.