yhzdys commented on code in PR #788:
URL:
https://github.com/apache/httpcomponents-client/pull/788#discussion_r2700614819
##########
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:
@rschmitt I've implemented the changes as discussed. The ExchangeIdGenerator
interface has been added to allow custom exchange ID generation. Please review
when convenient. Thank you!
--
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]