Hi Camel devs,

I was looking into the source code for Netty4 component and I found one 
potential inconsistency.

Here there is a check for if SslHandler is an instanceof ChannelHandlerFactory

boolean factory = sslHandler instanceof ChannelHandlerFactory;
https://github.com/apache/camel/blob/camel-2.23.x/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyConfiguration.java#L156

However, unlike the encoders/decoders it seems there is no call to the 
newChannelHandler method in this case so it seems that extending SslHandler and 
implementing ChannelHandlerFactory interface does not work as expected.
https://github.com/apache/camel/blob/master/components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/HttpServerInitializerFactory.java#L87

Hence I am seeing below error when I did the same:
io.netty.handler.ssl.SslHandler is not a @Sharable handler, so can't be added 
or removed multiple times.

I'm not sure if this is a bug or if I'm misunderstanding something. Does anyone 
know why sslHandler was not implemented with the ChannelHandlerFactory logic 
similar to encoders/decoders?

Thanks,
Adam

Reply via email to