ibm-messaging / mq-golang

Calling IBM MQ from Go applications
Apache License 2.0
168 stars 60 forks source link

Failed to read message larger than 4MB #118

Closed JuppLike closed 5 years ago

JuppLike commented 5 years ago

Version Info: MQ: 9.0.5 MQ-golang: latest go 1.11

buffer := make([]byte, 10000000) // MQGET from inputqueue getmqmd := ibmmq.NewMQMD() gmo := ibmmq.NewMQGMO() gmo.Options = ibmmq.MQGMO_NO_SYNCPOINT | ibmmq.MQGMO_FAIL_IF_QUIESCING | ibmmq.MQGMO_WAIT gmo.WaitInterval = waitInterval len, err := inQueue.Get(getmqmd, gmo, buffer)

When I run this code I get.

MQGET: MQCC = MQCC_FAILED [2] MQRC = MQRC_DATA_LENGTH_ERROR [2010]

With a buffer length smaller of 4 MB everything works fine for message smaller than 4 MB, get MQGET: MQCC = MQCC_WARNING [1] MQRC = MQRC_TRUNCATED_MSG_FAILED for message > 4MB

How can I process this message with mq-golang?

JuppLike commented 5 years ago

Sorry, I didnt set the maxMsgLength of the channel. Afterwards the package word as expected.