Skip to content

Commit 0337bb0

Browse files
committed
Set ApacheConnectionClosingStrategy
1 parent 40c4f70 commit 0337bb0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/atomgraph/linkeddatahub/Application.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@
231231
import org.glassfish.hk2.utilities.binding.AbstractBinder;
232232
import org.glassfish.jersey.client.ClientConfig;
233233
import org.glassfish.jersey.apache.connector.ApacheClientProperties;
234+
import org.glassfish.jersey.apache.connector.ApacheConnectionClosingStrategy;
234235
import org.glassfish.jersey.apache.connector.ApacheConnectorProvider;
235236
import org.glassfish.jersey.client.ClientProperties;
236237
import org.glassfish.jersey.client.RequestEntityProcessing;
@@ -1414,7 +1415,7 @@ public void releaseConnection(final HttpClientConnection managedConn, final Obje
14141415
//config.property(ClientProperties.CONNECT_TIMEOUT, 1000);
14151416
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
14161417
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());
14181419
if (keepAliveStrategy != null) config.property(ApacheClientProperties.KEEPALIVE_STRATEGY, keepAliveStrategy);
14191420

14201421
return ClientBuilder.newBuilder().
@@ -1508,6 +1509,7 @@ public void releaseConnection(final HttpClientConnection managedConn, final Obje
15081509
config.property(ClientProperties.FOLLOW_REDIRECTS, true);
15091510
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
15101511
config.property(ApacheClientProperties.CONNECTION_MANAGER, conman);
1512+
config.property(ApacheClientProperties.CONNECTION_CLOSING_STRATEGY, new ApacheConnectionClosingStrategy.GracefulClosingStrategy());
15111513

15121514
return ClientBuilder.newBuilder().
15131515
withConfig(config).

0 commit comments

Comments
 (0)