-
Notifications
You must be signed in to change notification settings - Fork 121
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
Add portable Http Connector Engine interface #1282
Comments
What shall vendors do that currently are JAX-RS compatible, but that do not have replaceable backends, but just one hardcoded backend? Shall they not be JAX-RS compatible anymore or do you pay their costs for reworking their kernel to support replaceable backends? Having said that, wouldn't it be enough to mandata that IF a vendor supports replaceable backends, then they MUST support predefined properties to configure them? |
I hope the spec provider can provide their The end user can also implement its own HttpConnector impl to replace the one in the provider. For example, in one project, we use OkHttp as an HTTP client to handle all client cases, but this Jaxrs provider does not provide an OKHttp version, to align with our codes and we do not want to introduce new dependencies, we can impl a HttpConnector based on OkHttp. |
@hantsy Can you try to prototype some way to hook in the connector? It is not clear to me what |
This imposes strong restrictions on how a JAX-RS implementation is actually designed -- something that an API shall never do. |
It is not just an API, in the end user's mind, it is a framework, that should be provide more flexible options. |
The new Spring 6.x provides a Check the following docs for more details.
|
Jakarta REST is not a framework, it is just an API. |
I think if we adopt this idea, then there should be a separate Jakarta subprojekt for defining such an API that we can build upon. |
One thing to point out is the JDK HTTP Client doesn't implement everything needed to work with the FWIW RESTEasy does this with an SPI already, so it would work for RESTEasy. That said, I don't think the Jakarta REST API should provide any implementations, nor should they be required to even implement one. I can see this useful to an end user where they might want to use some custom HTTP client. |
I do not think so. Jakarta Rest |
If possible to port this to the public Rest specification? |
Because it makes sense to have the same interface whereever pure HTTP services are needed. Jakarta REST is just a REST API, not a generic HTTP client. What we need here is not a REST-only API, but a pure HTTP API. It makes sense that other projects (even non-Jakarta-projects) make use of this. In fact, it should be defined by the vendors of these HTTP Clients, not the the consuming REST engines. |
Currently, we(the end developers) do not know which the rest clients use which HTTP Client library in the background, like the issue I mentioned in #1276, we need to add more provider-specific properties to use it.
I would like use a more fine-grained configuration on the background HttpClient itself directly.
Expose a HttpConnector interface to allow developers to customize it as expected.
For example,
JdkHttpClientHttpConnector
can be instantize simply as the following.Or accept a your custom JDK 11
HttpClient
.The text was updated successfully, but these errors were encountered: