On 10/22/07, Niklas Therning <[EMAIL PROTECTED]> wrote: > Paul Vitic wrote: > > I have just realised that it is not allowed to implement more than one > > ProtocolCodecFilter in a filter chain. So what is the best way to decode a > > message which has multiple protocol layers. I.e. a proprietary application > > level protocol enveloped inside another proprietary application level > > protocol enveloped inside http. The tricky part is that the messages > > sometimes come from an http client in this way and sometimes come from a TCP > > client only enveloped by the last layer of proprietary application level > > protocol. Should I extend the sample http request decoder?
If you wrote a protocol codec for HTTP, the HTTP message instance should contain a ByteBuffer (content). Now you need to decode the ByteBuffer which is encoded in some proprietary encoding. Write a custom IoFilter that gets the ByteBuffer from the HTTP message object and sets the decoded data back to the HTTP message object. You can even write more filters to implement multi-layered protocols. > IIRC this has been fixed in trunk. What version of MINA are you using? > If you try out the latest version from Subversion you should be able to > add more than one ProtocolCodecFilter to your chain, if I'm not mistaken. Yes. Please let me know if it doesn't work as expected. HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP Key ID: 0x0255ECA6
