|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
java.io.EOFException thrown by MQMessage.readmessage |
« View previous topic :: View next topic » |
Author |
Message
|
mjain_mq |
Posted: Wed Jul 17, 2013 5:54 am Post subject: java.io.EOFException thrown by MQMessage.readmessage |
|
|
Newbie
Joined: 14 Jul 2013 Posts: 6
|
Hi
I am getting below error while tryting to read a particular message, while the code works fine for other.
java.io.EOFException
at com.ibm.mq.MQMessage.readConvertedString(MQMessage.java:828)
at com.ibm.mq.MQMessage.readString(MQMessage.java:785)
I have already verified that the message is a valid XML and contains no invalid chatracters. I am still trying to establish this failure scenario but any suggestion will come as gr8 help.
Thanks
Code: |
MQGetMessageOptions getOptions = new MQGetMessageOptions();
getOptions.options = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQGMO_SYNCPOINT;
int openInQOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING;
inQueue = xaQMgr.getQueueManager().accessQueue(inputQueue, openInQOptions, null, null, null);
inQueue.get(message, getOptions);
String msg = message.readString(message.getMessageLength()); |
|
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 17, 2013 7:56 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looks to me like maybe your options are not set right.
Think about MQC.MQGMO vs MQC.MQPMO vs MQC.MQOO
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
rekarm01 |
Posted: Thu Jul 18, 2013 12:34 am Post subject: Re: java.io.EOFException thrown by MQMessage.readmessage |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
mjain_mq wrote: |
Code: |
String msg = message.readString(message.getMessageLength()); |
|
The argument for readString() specifies the number of characters to read from the message, but getMessageLength() returns the number of bytes in the message.
For character sets that use more than one byte per character, readString() would try to read too many characters. readStringOfByteLength() might work out better. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|