camel netty server ByteToMessageDecoder error..

85 views
Skip to first unread message

James Kim

unread,
Jul 7, 2017, 1:51:24 AM7/7/17
to Netty discussions
as i am a beginner of camel. i wanna get a hint to solve my problem. here is my code


@Configuration
public class ChannelHandlerFactoryByteArrayDecoder implements ChannelHandlerFactory {

    @Bean(name="vpaByteDecoder")
    @Qualifier("vpaByteDecoder")
    public ChannelHandler newChannelHandler() {
      return (ChannelHandler) new VpaByteDecoder();
    }
    public  class VpaByteDecoder extends ByteToMessageDecoder{

    }
}



and my router is

from("netty4:tcp://localhost:8004?textline=true&sync=true&decoders=#vpaByteDecoder&encoders=#stringEncoder").

and error is invoked like this

io.netty.channel.ChannelPipelineException: config.ChannelHandlerFactoryDecoder$VpaByteDecoder is not a @Sharable handler, so can't be added or removed multiple times.


ByteToMessageDecoder should not sharable. so i implenmented ChannelHandlerFactory

i dont know the reason.plaease show me the way to understand my problem.

Norman Maurer

unread,
Jul 7, 2017, 2:00:10 AM7/7/17
to ne...@googlegroups.com
You should ask on the camel mailinglist as it seems like camel tries to add the handler multiple times
--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netty/d93f8149-2ad6-4006-bf58-628d63d3db8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages