rschmitt commented on code in PR #788:
URL: 
https://github.com/apache/httpcomponents-client/pull/788#discussion_r2699694724


##########
httpclient5/src/main/java/org/apache/hc/client5/http/protocol/HttpClientContext.java:
##########
@@ -466,6 +467,18 @@ public void setExchangeId(final String exchangeId) {
         this.exchangeId = exchangeId;
     }
 
+    /**
+     * @since 5.7
+     */
+    public String setExchangeId(final Supplier<String> supplier) {
+        final String exchangeId = this.exchangeId; // avoid getfield opcode
+        if (exchangeId == null) {
+            return this.exchangeId = supplier.get();
+        } else {
+            return exchangeId;
+        }
+    }

Review Comment:
   Also, there should be a documented contract for custom exchange ID 
suppliers, i.e. they must return a unique, non-null, non-blank string every 
time they are called.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to