Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #6957] Support Proxy Protocol for gRPC and Remoting server #6958

Merged
merged 26 commits into from
Jul 4, 2023
Merged

[ISSUE #6957] Support Proxy Protocol for gRPC and Remoting server #6958

merged 26 commits into from
Jul 4, 2023

Conversation

dingshuangxi888
Copy link
Contributor

Which Issue(s) This PR Fixes

Fixes #6957

Brief Description

When the RocketMQ client accesses the RocketMQ server through multiple layers of NAT or TCP proxies, the server is unable to obtain the actual IP address information of the client. In such cases, the HAProxy's Proxy protocol can be introduced to transparently pass the initial TCP connection information of the client. This allows the server to accurately identify the source of message production and consumption.

How Did You Test This Change?

I have applied for a proxy service that supports the transparent transmission of the Proxy Protocol. The client sends requests to the server through this proxy service. The server successfully retrieves the Proxy Protocol data and extracts the client's real IP address from it. The server then sets this IP address in the message's attributes.

Copy link
Member

@mxsm mxsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dingshuangxi888 CI execution failed, please fix

pom.xml Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2023

Codecov Report

Attention: Patch coverage is 29.11392% with 112 lines in your changes missing coverage. Please review.

Project coverage is 42.66%. Comparing base (5c3bd98) to head (e1899f0).
Report is 476 commits behind head on develop.

Files with missing lines Patch % Lines
...etmq/proxy/grpc/ProxyAndTlsProtocolNegotiator.java 0.00% 57 Missing ⚠️
...e/rocketmq/remoting/netty/NettyRemotingServer.java 55.31% 14 Missing and 7 partials ⚠️
...etmq/proxy/grpc/interceptor/HeaderInterceptor.java 0.00% 17 Missing ⚠️
...he/rocketmq/proxy/grpc/constant/AttributeKeys.java 0.00% 11 Missing ⚠️
...pache/rocketmq/remoting/common/RemotingHelper.java 84.61% 1 Missing and 1 partial ⚠️
.../apache/rocketmq/remoting/netty/AttributeKeys.java 81.81% 2 Missing ⚠️
...che/rocketmq/common/constant/HAProxyConstants.java 0.00% 1 Missing ⚠️
.../apache/rocketmq/proxy/grpc/GrpcServerBuilder.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #6958      +/-   ##
=============================================
- Coverage      42.68%   42.66%   -0.03%     
- Complexity      9236     9239       +3     
=============================================
  Files           1133     1136       +3     
  Lines          80492    80635     +143     
  Branches       10515    10538      +23     
=============================================
+ Hits           34362    34404      +42     
- Misses         41834    41927      +93     
- Partials        4296     4304       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@drpmma drpmma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lizhimins lizhimins merged commit 00fc42b into apache:develop Jul 4, 2023
lizhimins pushed a commit to lizhimins/rocketmq that referenced this pull request Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Support Proxy Protocol for gRPC and Remoting server
6 participants