camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From milltj <>
Subject Incomplete Messages
Date Wed, 21 Aug 2013 18:38:40 GMT
I have been playing with the Mina2 component and have a need to implement my
own decoder.  The messages that I receive have a 28 byte header followed by
a variable length XML message.  The header contains the length of the XML
message as well as some other information.  I am running into a problem that
in some cases the reported XML length in the header is greater then the what
is reported when calling in.remaining().  For example, the XML Length header
contains a length of 2735 bytes, but the in.remaining() reports 2020.  if I
call in.get(byte[]) and pass it a byte array of size 2735, I get an
UnderrunException.  If I only retrieve the bytes in the buffer then I get an
incomplete message. I have looked at the example at the Mina website but I
am confused by it, I don't quite follow what it is doing.  Can someone point
me to an example of what I would need to implement in my doDecode(...)
method that would insure I get a complete message everytime? 

- Tim

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message