feat: add Apache HttpClient 5.x adapter support#3614
Open
uuuyuqi wants to merge 3 commits intoalibaba:1.8from
Open
feat: add Apache HttpClient 5.x adapter support#3614uuuyuqi wants to merge 3 commits intoalibaba:1.8from
uuuyuqi wants to merge 3 commits intoalibaba:1.8from
Conversation
Add sentinel-apache-httpclient5-adapter module that integrates Sentinel flow control with Apache HttpClient 5.x outgoing HTTP requests. Features: - ExecChainHandler-based integration (SentinelApacheHttpClient5Handler) - Configurable resource name extraction (METHOD:URL format by default) - Query string and fragment stripping in resource names - Customizable fallback handling (throws SentinelRpcException by default) - Configurable resource name prefix (default: "httpclient:") Follows the same architecture pattern as the existing HttpClient 4.x adapter while adapting to HC5's ExecChainHandler API. Closes alibaba#3614 Change-Id: I966295da9419beac99451fc6c9c31b1d75a9e7e6 Co-developed-by: Cursor <noreply@cursor.com>
After the 1.8.9 release, several PRs have been merged but the development version was not updated. Bump to 1.8.10-SNAPSHOT for next development iteration. Change-Id: I2b7ba2b5b4e9e39d1f9749288d54b9926a512132 Co-developed-by: Cursor <noreply@cursor.com>
Change-Id: I1fe4682e41185dc7c8ed30541989f2881ba87549 Co-developed-by: Cursor <noreply@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add
sentinel-apache-httpclient5-adaptermodule that integrates Sentinel flow control with Apache HttpClient 5.x outgoing HTTP requests.This is a companion to the existing
sentinel-apache-httpclient-adapter(4.x), providing the same Sentinel protection capabilities for users who have migrated to HttpClient 5.x.Features
SentinelApacheHttpClient5Handlerimplements HC5'sExecChainHandlerinterface, allowing seamless integration viaHttpClients.custom().addExecInterceptorBefore()METHOD:URLformat resource names (e.g.,GET:http://example.com/api/users), with query string and fragment strippingSentinelRpcException; users can implement customApacheHttpClientFallbackfor alternative responseshttpclient:, fully customizableUsage
Architecture
Follows the same design pattern as the existing HttpClient 4.x adapter:
SentinelApacheHttpClient5Handler— core handler (ExecChainHandler)SentinelApacheHttpClientConfig— configuration holderApacheHttpClientResourceExtractor/DefaultApacheHttpClientResourceExtractor— resource name extractionApacheHttpClientFallback/DefaultApacheHttpClientFallback— fallback handlingTest Coverage
Closes #3614
Made with Cursor