0
votes

Am working on UDP server which have multiple handlers.

Look at my code how I bootstrap the channel.

return new Bootstrap().
                group(rtpNioEventLoopGroup()).
                channel(NioDatagramChannel.class).
                handler(saveToRepoHandler()).                
                handler(informPartyHandler()); 

Now my save-repo and inform-party need to be executed asynchronously. They have no dependency to each other.

Does netty execute them asynchronously ?

1

1 Answers

0
votes

Calling handler(...) multiple times will just replace the previous set handler. You want to use a ChannelInitializer and add the ChannelHandlers there. Check our examples or the javadocs for details.