|
231 | 231 | import org.glassfish.hk2.utilities.binding.AbstractBinder; |
232 | 232 | import org.glassfish.jersey.client.ClientConfig; |
233 | 233 | import org.glassfish.jersey.apache.connector.ApacheClientProperties; |
| 234 | +import org.glassfish.jersey.apache.connector.ApacheConnectionClosingStrategy; |
234 | 235 | import org.glassfish.jersey.apache.connector.ApacheConnectorProvider; |
235 | 236 | import org.glassfish.jersey.client.ClientProperties; |
236 | 237 | import org.glassfish.jersey.client.RequestEntityProcessing; |
@@ -1414,7 +1415,7 @@ public void releaseConnection(final HttpClientConnection managedConn, final Obje |
1414 | 1415 | //config.property(ClientProperties.CONNECT_TIMEOUT, 1000); |
1415 | 1416 | config.property(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.BUFFERED); // https://stackoverflow.com/questions/42139436/jersey-client-throws-cannot-retry-request-with-a-non-repeatable-request-entity |
1416 | 1417 | config.property(ApacheClientProperties.CONNECTION_MANAGER, conman); |
1417 | | - //config.property(ApacheClientProperties.CONNECTION_CLOSING_STRATEGY, new ApacheConnectionClosingStrategy.GracefulClosingStrategy()); |
| 1418 | + config.property(ApacheClientProperties.CONNECTION_CLOSING_STRATEGY, new ApacheConnectionClosingStrategy.GracefulClosingStrategy()); |
1418 | 1419 | if (keepAliveStrategy != null) config.property(ApacheClientProperties.KEEPALIVE_STRATEGY, keepAliveStrategy); |
1419 | 1420 |
|
1420 | 1421 | return ClientBuilder.newBuilder(). |
@@ -1508,6 +1509,7 @@ public void releaseConnection(final HttpClientConnection managedConn, final Obje |
1508 | 1509 | config.property(ClientProperties.FOLLOW_REDIRECTS, true); |
1509 | 1510 | config.property(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.BUFFERED); // https://stackoverflow.com/questions/42139436/jersey-client-throws-cannot-retry-request-with-a-non-repeatable-request-entity |
1510 | 1511 | config.property(ApacheClientProperties.CONNECTION_MANAGER, conman); |
| 1512 | + config.property(ApacheClientProperties.CONNECTION_CLOSING_STRATEGY, new ApacheConnectionClosingStrategy.GracefulClosingStrategy()); |
1511 | 1513 |
|
1512 | 1514 | return ClientBuilder.newBuilder(). |
1513 | 1515 | withConfig(config). |
|
0 commit comments