mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From C├ęsar Fernando Henriques <ce...@alttab.com.ar>
Subject ProtocolEncoder/Decoder and MessageEncoder/Decoder
Date Wed, 20 May 2009 17:37:27 GMT
I have sended this msg to the users mailing list, my apologies if you are
subscribed to both lists.
-----------------------------------

Hi guys, I'm new to mina so pls be kind If I made silly questions. ;-)

I need to create an application protocol on top of http. I have been playing
with AsyncWeb and HttpRequest/Response messages and HttpCodecFactory.

My questions is:

Is there any way to work with HttpCodecFactory/ProtocolEncoder/ProtocolDecoder
for the "low level" Http Protocol and add another ProtocolCodecFilter to
encode/decode my custom messages I have been playing with Messages like
AutheticationRequest/AuthenticationResponse both extends from
DefaultHttpRequest/DefultHttpResponse, but I'm stuck with this error every
time I call IoSession.write(DefultHttpResponse) (this just happen when I add
MyCodecFactory to the FilterChain )

UnknownMessageTypeException: No message encoder found for message:
org.apache.asyncweb.common.DefaultHttpResponse@3c9c31

this is my initialization code

HttpCodecFactory httpCodec = new HttpCodecFactory();
        acceptor.getFilterChain().addLast("httpCodec",
                new ProtocolCodecFilter(httpCodec));

        MyCodecFactory mycodec= new MyCodecFactory ();
        mycodec.addMessageEncoder(AuthenticationRequest.class,
                AuthenticationRequestEncoder.class);
        mycodec.addMessageEncoder(AuthenticationResponse.class,
                AuthenticationResponseEncoder.class);

        acceptor.getFilterChain().addLast("mycodec",
                new ProtocolCodecFilter(mycodec));

any idea?

Thank you guys!

Cesar

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message