You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ok2c (via GitHub)" <gi...@apache.org> on 2023/03/28 10:39:21 UTC

[GitHub] [maven-resolver] ok2c commented on a diff in pull request #274: [MRESOLVER-347] Ability to control conn reuse

ok2c commented on code in PR #274:
URL: https://github.com/apache/maven-resolver/pull/274#discussion_r1150385629


##########
maven-resolver-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java:
##########
@@ -159,6 +159,37 @@ public final class ConfigurationProperties {
      */
     public static final boolean DEFAULT_HTTP_PREEMPTIVE_AUTH = false;
 
+    /**
+     * Should HTTP client reuse connections (in other words, pool connections) or not?
+     *
+     * @see #DEFAULT_HTTP_REUSE_CONNECTIONS
+     * @since 1.9.8
+     */
+    public static final String HTTP_REUSE_CONNECTIONS = PREFIX_CONNECTOR + "http.reuseConnections";
+
+    /**
+     * The default value to use if {@link #HTTP_REUSE_CONNECTIONS} isn't set (true).
+     *
+     * @since 1.9.8
+     */
+    public static final boolean DEFAULT_HTTP_REUSE_CONNECTIONS = true;
+
+    /**
+     * The maximum TTL (in milliseconds) HTTP client should apply to connections when reused.
+     *
+     * @see #DEFAULT_HTTP_CONNECTION_MAX_TTL
+     * @see <a href="https://hc.apache.org/httpcomponents-client-4.5.x/current/httpclient/apidocs/org/apache/http/conn/ConnectionKeepAliveStrategy.html">ConnectionKeepAliveStrategy</a>
+     * @since 1.9.8
+     */
+    public static final String HTTP_CONNECTION_MAX_TTL = PREFIX_CONNECTOR + "http.connectionMaxTtl";
+
+    /**
+     * The default value to use if {@link #HTTP_CONNECTION_MAX_TTL} isn't set (-1 or "no suggested duration"/forever).
+     *
+     * @since 1.9.8
+     */
+    public static final long DEFAULT_HTTP_CONNECTION_MAX_TTL = -1;

Review Comment:
   I would generally recommend using a finite TTL for all connections, though one may want to set it relatively high, say 5 or 10 minutes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org