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 04:03:47 UTC

[GitHub] [rocketmq] mrhbj opened a new issue #3545: Bootstrap handler Is it necessary?

mrhbj opened a new issue #3545:
URL: https://github.com/apache/rocketmq/issues/3545


          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!
   


-- 
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



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

Posted by GitBox <gi...@apache.org>.
mrhbj commented on issue #3545:
URL: https://github.com/apache/rocketmq/issues/3545#issuecomment-981469209


   > > ```
   > >    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.
   
   yes, I agree.


-- 
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



[GitHub] [rocketmq] mrhbj edited a comment on issue #3545: Bootstrap handler Is it necessary?

Posted by GitBox <gi...@apache.org>.
mrhbj edited a comment on issue #3545:
URL: https://github.com/apache/rocketmq/issues/3545#issuecomment-981469209


   > > ```
   > >    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.
   
   yes, I agree, can I remove "Bootstrap handler = ",  because handler doesn't use by other 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



[GitHub] [rocketmq] mrhbj closed issue #3545: Bootstrap handler Is it necessary?

Posted by GitBox <gi...@apache.org>.
mrhbj closed issue #3545:
URL: https://github.com/apache/rocketmq/issues/3545


   


-- 
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



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

Posted by GitBox <gi...@apache.org>.
mrhbj commented on issue #3545:
URL: https://github.com/apache/rocketmq/issues/3545#issuecomment-981613623


   #3546 


-- 
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



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

Posted by GitBox <gi...@apache.org>.
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