-
Notifications
You must be signed in to change notification settings - Fork 183
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
Document HTTP/2 support #330
Conversation
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
@@ -68,6 +68,8 @@ Transport transport = new RestClientTransport(restClient, | |||
OpenSearchClient client = new OpenSearchClient(transport); | |||
``` | |||
|
|||
Upcoming OpenSearch `3.0.0` release brings HTTP/2 support and as such, the `RestClientTransport` would switch to HTTP/2 if available (for both HTTPS and/or HTTP protocols). The desired protocol could be forced using `RestClientBuilder.HttpClientConfigCallback`. |
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.
How can I see what protocol has been chosen?
Example of how I would switch to/from HTTP/2?
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.
How can I see what protocol has been chosen?
Basically this could be done by:
- inspecting the traffic
- logging requests and responses (they contain HTTP protocol version)
I am not sure what kind of prove we could provide here.
Example of how I would switch to/from HTTP/2?
RestClientBuilder.HttpClientConfigCallback
should be documented in core but I will add the configuration snippet for Apache HttpClient 5 transport.
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.
For documentation generally I ask myself "what would I do". So if you think logging is how you'd do it, I'd show here (or somewhere in the docs) how to log the HTTP version chosen.
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.
For documentation generally I ask myself "what would I do". So if you think logging is how you'd do it, I'd show here (or somewhere in the docs) how to log the HTTP version chosen.
This is not something we should be worried about here (I think), there are few things involved on our behalf:
- for HTTPS, we have the ALPN protocol in place
- for HTTP, we have
Upgrade
in place
The OpenSearch Java client could connect to 2.x
clusters fe, that would mean using HTTP/1.1 no matter what. Generally, forcing the protocol is the only reliable way (I am aware of) to make sure only HTTP/1.1 or only HTTP/2 has to be used.
To this point, we would be building features on top of HTTP/2 very soon (I believe), so the presence of HTTP/2 would be obvious.
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.
Fair enough.
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
@@ -56,28 +56,46 @@ There are multiple low level transports which `OpenSearchClient` could be config | |||
### Create a client using `RestClientTransport` | |||
|
|||
```java | |||
Transport transport = new RestClientTransport(restClient, new JacksonJsonpMapper()); | |||
OpenSearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper()); |
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.
Just noticed that OpenSearchClient
does not accept Transport
but OpenSearchTransport
, fixed that in the guide
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.
Perfect.
@VachaShah mind a review please (documentation update)? thank you! |
Signed-off-by: Andriy Redko andriy.redko@aiven.io
Description
Document HTTP/2 support (#215)
Issues Resolved
Closes #215
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.