-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improve][client] Implement HTTP client using javax.ws.rs #23905
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
base: master
Are you sure you want to change the base?
Conversation
|
This would be a major change to the admin client. It feels that there's something wrong in the AuthenticationSasl if it gets coupled to the client type.
What does "maintain the TLS context" mean in practice? What are the different implementation options? |
|
One detail to consider is that we'd like to migrate off |
Should be client, not admin client?
This authentication process requires the broker endpoint, and we pass the URL string, which indicates to the broker which endpoint is being requested.
Just pass the WebTarget to the Authtication. I will make a new PR to handle this thing.
I think we can only pass the WebTarget to the auth. Do you any ideas? Using jakarta.ws.rs instead of javax.ws.rs is a good idea, but fixing the bug is still important, so I want to keep this path. |
Signed-off-by: Zixuan Liu <[email protected]>
Signed-off-by: Zixuan Liu <[email protected]>
1be3d96 to
e1abde2
Compare
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching the HTTP client in pulsar-client-admin is a major change and it needs a PIP to document the change. We should also ensure that the performance is similar. While changing the client, we should also get rid of the async-http-client dependency.
Motivation
I encountered an issue when using Kerberos and TLS transport to connect to the broker. The
pulsar-adminandpulsar-client(for HTTP lookup) failed to work as expected.In the
org.apache.pulsar.client.impl.auth.AuthenticationSasl#authenticationStagemethod, the broker requests should use theWebTargetprovided by thepulsar-adminorpulsar-clientHTTP clients. However, the current implementation creates a new HTTP client to construct theWebTarget, causing the TLS context to be lost.Currently, the
pulsar-adminHTTP client is built onjavax.ws.rsand AHC (Async Http Client), while thepulsar-clientHTTP client relies only on AHC. To resolve this inconsistency and maintain the TLS context, we need to refactor thepulsar-clientto provide the requiredWebTarget.Modifications
Package Changes:
org.apache.pulsar.client.admin.internal.httptoorg.apache.pulsar.client.internal.http.pulsar-client-admintopulsar-client.Refactored HTTP Client:
HttpClient.javato useAsyncHttpConnectorProviderandAsyncHttpConnectorfor a unified and consistent implementation.Fixed Client Calls:
pulsar-clientcalls to utilize the refactored HTTP client.Documentation
docdoc-requireddoc-not-neededdoc-complete