ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » readUTF() throws EOFException

Post new topic  Reply to topic Goto page Previous  1, 2
 readUTF() throws EOFException « View previous topic :: View next topic » 
Author Message
IanAlderson
PostPosted: Fri Jun 20, 2014 5:09 am    Post subject: Reply with quote

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
View user's profile Send private message
al000y
PostPosted: Fri Jun 20, 2014 6:27 am    Post subject: Reply with quote

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
View user's profile Send private message
IanAlderson
PostPosted: Sun Jun 22, 2014 11:47 pm    Post subject: Reply with quote

Novice

Joined: 23 Apr 2014
Posts: 17

al000y,
Glad to hear you got it to work.

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » readUTF() throws EOFException
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.