You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "dingshuangxi888 (via GitHub)" <gi...@apache.org> on 2023/06/07 07:04:02 UTC

[GitHub] [rocketmq] dingshuangxi888 opened a new pull request, #6867: [ISSUE #6866] Support dynamic modification of grpc TLS mode to improve the scalability of ProtocolNegotiator

dingshuangxi888 opened a new pull request, #6867:
URL: https://github.com/apache/rocketmq/pull/6867

   Support dynamic modification of grpc TLS mode to improve the scalability of ProtocolNegotiator
   
   <!-- Please make sure the target branch is right. In most case, the target branch should be `develop`. -->
   
   ### Which Issue(s) This PR Fixes
   
   <!-- Please ensure that the related issue has already been created, and [link this pull request to that issue using keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>) to ensure automatic closure. -->
   
   Fixes #6866
   
   ### Brief Description
   
   Support dynamic modification of grpc TLS mode to improve the scalability of ProtocolNegotiator
   
   <!-- Write a brief description for your pull request to help the maintainer understand the reasons behind your changes. -->
   
   ### How Did You Test This Change?
   
   Yes.
   
   <!-- In order to ensure the code quality of Apache RocketMQ, we expect every pull request to have undergone thorough testing. -->
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] dingshuangxi888 commented on a diff in pull request #6867: [ISSUE #6866] Move the judgment logic of grpc TLS mode to improve the scalability of ProtocolNegotiator

Posted by "dingshuangxi888 (via GitHub)" <gi...@apache.org>.
dingshuangxi888 commented on code in PR #6867:
URL: https://github.com/apache/rocketmq/pull/6867#discussion_r1221075305


##########
proxy/src/main/java/org/apache/rocketmq/proxy/grpc/OptionalSSLProtocolNegotiator.java:
##########
@@ -50,45 +60,83 @@ public AsciiString scheme() {
     }
 
     @Override
-    public ChannelHandler newHandler(GrpcHttp2ConnectionHandler grpcHttp2ConnectionHandler) {
-        ChannelHandler plaintext =
-            InternalProtocolNegotiators.serverPlaintext().newHandler(grpcHttp2ConnectionHandler);
-        ChannelHandler ssl =
-            InternalProtocolNegotiators.serverTls(sslContext).newHandler(grpcHttp2ConnectionHandler);
-        return new PortUnificationServerHandler(ssl, plaintext);
+    public ChannelHandler newHandler(GrpcHttp2ConnectionHandler grpcHandler) {
+        return new PortUnificationServerHandler(grpcHandler);
     }
 
     @Override
     public void close() {}
 
     public static class PortUnificationServerHandler extends ByteToMessageDecoder {
+
         private final ChannelHandler ssl;
         private final ChannelHandler plaintext;
 
-        public PortUnificationServerHandler(ChannelHandler ssl, ChannelHandler plaintext) {
-            this.ssl = ssl;
-            this.plaintext = plaintext;
+        public PortUnificationServerHandler(GrpcHttp2ConnectionHandler grpcHandler) {
+            this.ssl = InternalProtocolNegotiators.serverTls(loadSslContext())

Review Comment:
   Yes, it has been fixed, please review again.



-- 
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: commits-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] xdkxlk merged pull request #6867: [ISSUE #6866] Move the judgment logic of grpc TLS mode to improve the scalability of ProtocolNegotiator

Posted by "xdkxlk (via GitHub)" <gi...@apache.org>.
xdkxlk merged PR #6867:
URL: https://github.com/apache/rocketmq/pull/6867


-- 
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: commits-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] xdkxlk commented on a diff in pull request #6867: [ISSUE #6866] Support dynamic modification of grpc TLS mode to improve the scalability of ProtocolNegotiator

Posted by "xdkxlk (via GitHub)" <gi...@apache.org>.
xdkxlk commented on code in PR #6867:
URL: https://github.com/apache/rocketmq/pull/6867#discussion_r1221012939


##########
proxy/src/main/java/org/apache/rocketmq/proxy/grpc/OptionalSSLProtocolNegotiator.java:
##########
@@ -50,45 +60,83 @@ public AsciiString scheme() {
     }
 
     @Override
-    public ChannelHandler newHandler(GrpcHttp2ConnectionHandler grpcHttp2ConnectionHandler) {
-        ChannelHandler plaintext =
-            InternalProtocolNegotiators.serverPlaintext().newHandler(grpcHttp2ConnectionHandler);
-        ChannelHandler ssl =
-            InternalProtocolNegotiators.serverTls(sslContext).newHandler(grpcHttp2ConnectionHandler);
-        return new PortUnificationServerHandler(ssl, plaintext);
+    public ChannelHandler newHandler(GrpcHttp2ConnectionHandler grpcHandler) {
+        return new PortUnificationServerHandler(grpcHandler);
     }
 
     @Override
     public void close() {}
 
     public static class PortUnificationServerHandler extends ByteToMessageDecoder {
+
         private final ChannelHandler ssl;
         private final ChannelHandler plaintext;
 
-        public PortUnificationServerHandler(ChannelHandler ssl, ChannelHandler plaintext) {
-            this.ssl = ssl;
-            this.plaintext = plaintext;
+        public PortUnificationServerHandler(GrpcHttp2ConnectionHandler grpcHandler) {
+            this.ssl = InternalProtocolNegotiators.serverTls(loadSslContext())

Review Comment:
   SslContext is only need to load once



-- 
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: commits-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] xdkxlk commented on a diff in pull request #6867: [ISSUE #6866] Support dynamic modification of grpc TLS mode to improve the scalability of ProtocolNegotiator

Posted by "xdkxlk (via GitHub)" <gi...@apache.org>.
xdkxlk commented on code in PR #6867:
URL: https://github.com/apache/rocketmq/pull/6867#discussion_r1221012939


##########
proxy/src/main/java/org/apache/rocketmq/proxy/grpc/OptionalSSLProtocolNegotiator.java:
##########
@@ -50,45 +60,83 @@ public AsciiString scheme() {
     }
 
     @Override
-    public ChannelHandler newHandler(GrpcHttp2ConnectionHandler grpcHttp2ConnectionHandler) {
-        ChannelHandler plaintext =
-            InternalProtocolNegotiators.serverPlaintext().newHandler(grpcHttp2ConnectionHandler);
-        ChannelHandler ssl =
-            InternalProtocolNegotiators.serverTls(sslContext).newHandler(grpcHttp2ConnectionHandler);
-        return new PortUnificationServerHandler(ssl, plaintext);
+    public ChannelHandler newHandler(GrpcHttp2ConnectionHandler grpcHandler) {
+        return new PortUnificationServerHandler(grpcHandler);
     }
 
     @Override
     public void close() {}
 
     public static class PortUnificationServerHandler extends ByteToMessageDecoder {
+
         private final ChannelHandler ssl;
         private final ChannelHandler plaintext;
 
-        public PortUnificationServerHandler(ChannelHandler ssl, ChannelHandler plaintext) {
-            this.ssl = ssl;
-            this.plaintext = plaintext;
+        public PortUnificationServerHandler(GrpcHttp2ConnectionHandler grpcHandler) {
+            this.ssl = InternalProtocolNegotiators.serverTls(loadSslContext())

Review Comment:
   SslContext is only need to loaded once



-- 
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: commits-unsubscribe@rocketmq.apache.org

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