You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/11/29 09:48:41 UTC

[GitHub] [rocketmq] lizhiboo commented on issue #3545: Bootstrap handler Is it necessary?

lizhiboo commented on issue #3545:
URL: https://github.com/apache/rocketmq/issues/3545#issuecomment-981462950


   > ```
   >    NettyRemotingClient.java 
   >    Bootstrap handler = this.bootstrap.group(this.eventLoopGroupWorker).channel(NioSocketChannel.class)
   >         .option(ChannelOption.TCP_NODELAY, true)
   >         .option(ChannelOption.SO_KEEPALIVE, false)
   >         .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, nettyClientConfig.getConnectTimeoutMillis())
   >         .option(ChannelOption.SO_SNDBUF, nettyClientConfig.getClientSocketSndBufSize())
   >         .option(ChannelOption.SO_RCVBUF, nettyClientConfig.getClientSocketRcvBufSize())
   >         .handler(new ChannelInitializer<SocketChannel>() {
   >             @Override
   >             public void initChannel(SocketChannel ch) throws Exception {
   >                 ChannelPipeline pipeline = ch.pipeline();
   >                 if (nettyClientConfig.isUseTLS()) {
   >                     if (null != sslContext) {
   >                         pipeline.addFirst(defaultEventExecutorGroup, "sslHandler", sslContext.newHandler(ch.alloc()));
   >                         log.info("Prepend SSL handler");
   >                     } else {
   >                         log.warn("Connections are insecure as SSLContext is null!");
   >                     }
   >                 }
   >                 pipeline.addLast(
   >                     defaultEventExecutorGroup,
   >                     new NettyEncoder(),
   >                     new NettyDecoder(),
   >                     new IdleStateHandler(0, 0, nettyClientConfig.getClientChannelMaxIdleTimeSeconds()),
   >                     new NettyConnectManageHandler(),
   >                     new NettyClientHandler());
   >             }
   >         });
   > ```
   > 
   > Bootstrap handler Is it necessary? because it look like not used this handler name!
   
   variable handler is not used indeed, but bootstrap is configured after this running this code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org