eclipse-ee4j / eclipse-ee4j/jersey
The org.glassfish.jersey.apache.connector.ApacheConnector cannot be fully configured (e.g., retry handler) because the HttpClient is not accessible.
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
The ApacheConnector API has a design omission in that it does not allow the user to create and provide a configured HttpClient. In Jersey 1.7.x we were able to create an HttpClient, assign a retry handler directly, and provide the HttpClient to the Jersey client to use.
In Jersey 2.3.1, the ApacheConnector creates the HttpClient (a deprecated version of it) that the user cannot modify. The user can retrieve said client, but the HttpClient interface does not expose a configure it, it's essentially immutable. To make matters worse, this version of Jersey depends on httpclient 4.2.5 rather than 4.3\. There have been many important changes and deprecations in 4.3 which impact the ApacheConnector design.
A good fix would be to provide an additional constructor ApacheConnector(HttpClient httpclient, Configuration config). I would also strongly recommend upgrading to depend on httpclient 4.3, removing deprecations, and refactoring as necessary.
#### Affected Versions
[2.3.1, 2.4]
Contributor guide
Assessment
This issue has not been assessed yet.