|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
readUTF() throws EOFException |
« View previous topic :: View next topic » |
Author |
Message
|
IanAlderson |
Posted: Fri Jun 20, 2014 5:09 am Post subject: |
|
|
Novice
Joined: 23 Apr 2014 Posts: 17
|
Letting the MQOutput node set the codepage/encoding is sound advice. But I think the problem here for the OP is that he is using a readUTF api which expects a 2 byte length field to precede the data (i.e. not a codepage conversion issue). It's not clear what else he is doing in the compute node but if he is altering the message body in some way, then as far as I can tell he would need to recalculate the byte length for it to be useable for a readUTF call by the client - and I don't believe an MQOutput node will re-add an updated length field for you in the message body. I'd be happy to be corrected if that is the case.
The link I posted shows a workaround from the KC for ESQL to add that field, but it's not pretty. There may well be a better way to construct his flow depending upon what he is trying to achieve.
As suggested earlier, perhaps the simplest solution is for the client app to not use readUTF at all but one of the alternative readString* methods instead. ReadUTF and writeUTF are really more for how java deals with data conversions internally rather than the traditional approach of letting MQ convert to UTF8 for you based on the CCSID/encoding. |
|
Back to top |
|
 |
al000y |
Posted: Fri Jun 20, 2014 6:27 am Post subject: |
|
|
Apprentice
Joined: 25 Dec 2013 Posts: 30
|
IanAlderson wrote: |
Quote: |
If I remember correctly you can only use the readUTF method for messages which have been put using writeUTF since it expects the first byte (or 2) to contain the length of the message. |
Quote: |
Sorry, for that wrong info, the message is writer by writeUTF. |
Are you sure that's the case out of the flow (rather than from your original java app whose output is read by the flow)?
It looks like you need to code some special ESQL to make it behave like a writeUTF
http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/bc23530_.htm?lang=en |
Thank you , the missing thing was how to add the 2 bytes for the UTF.
Its work perfectly now. |
|
Back to top |
|
 |
IanAlderson |
Posted: Sun Jun 22, 2014 11:47 pm Post subject: |
|
|
Novice
Joined: 23 Apr 2014 Posts: 17
|
al000y,
Glad to hear you got it to work.
Thanks |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|