Why is my java application doing multiple gets because the receive buffer is too small?

When investigating a MQ JMS performance problem, I noticed that there was a pattern of

MQGET – 2080 (0820) (RC2080): MQRC_TRUNCATED_MSG_FAILED

followed by an MQGET with a bigger buffer which worked.

Being a performance person these double gets did not look right to me.

I spoke to Paul Titheridge of IBM who said this was fixed back in MQ V6 with a java property

com.ibm.mq.jmqi.defaultMaxMsgSize

If you specify

 -Dcom.ibm.mq.jmqi.defaultMaxMsgSize=8192
in the Java start-up you will get an 8KB buffer instead of the default 4KB.
Easy when you know how!

2 thoughts on “Why is my java application doing multiple gets because the receive buffer is too small?

  1. I would suggest that the best value for com.ibm.mq.jmqi.defaultMaxMsgSize is to use the value for “Maximum Message Length” (MAXMSGL) queue attribute from the particular queue that the code is doing the MQGET on.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s