Search This Blog

Thursday, June 12, 2008

MQ message length

In one of our project we had a problem, that you people should be aware of it.
The problem is :
An error message that we get from the MQ server, while trying to send/put a large XML data.
When I said large I mean bigger than 4M bytes .
i made some investigation here and i found out that there is a limit of the maximum message length (MAXMSGL) that
you can put in the Queue.


The MAXMSGL parameter appears in three places:
In the Channel level -> specifies the maximum length of a message that can be transmitted on the channel, in bytes.
In the Queue Manger level -> Maximum message length in bytes.
In the Queues level - as above.
The default in all the above places is – 4194304 bytes that’s 4M bytes.

To solve this limit I suggest to:
set the MAXMSGL parameter in the channel level to Zero (0) ,
That’s mean that maximum message length will be taken from the Queue Manger.

Increase the MAXMSGL parameter in the Queue Manger level .
"On AIX, Compaq NonStop Kernel, Compaq OpenVMS Alpha, HP-UX, z/OS, OS/2, OS/400, Solaris,
Windows, plus WebSphere MQ clients connected to these systems, the maximum message length is 100 MB (104 857 600 bytes)."

How to increase it ?
You can do it very easily from WebSphere MQ explorer, right click on the channel OR Queue manager -> properties
In the Extended Tab look for the "maximum message length" parameter and make the change there.

From the command line ( on all platform ):
runmqsc QM_MGR_1

ALTER QMGR MAXMSGL (10485760) // i.e set it to 10M bytes

ALTER CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) MAXMSGL(0)

ALTER QLOCAL(YANIVIN) MAXMSGL(10485760)

END

notes:
DO NOT FORGET TO CHANGE YOUR SOURCE CODE IF NEEDED.
set the MaximumMessageLength on the channel too, so the actull size will get from the Queue manager.

m_Channel.setMaximumMessageLength(0);

I hope you will find this information useful for your project.
enjoy
Yaniv Tzanany

No comments: