PascalSchumacher commented on code in PR #16227:
URL: https://github.com/apache/camel/pull/16227#discussion_r1975857142


##########
components/camel-http/src/main/java/org/apache/camel/component/http/OAuth2ClientConfigurer.java:
##########
@@ -37,55 +45,143 @@ public class OAuth2ClientConfigurer implements 
HttpClientConfigurer {
     private final String clientSecret;
     private final String tokenEndpoint;
     private final String scope;
+    private final boolean cacheTokens;
+    private final Long cachedTokensDefaultExpirySeconds;
+    private final Long cachedTokensExpirationMarginSeconds;
+    private final static Map<OAuth2URIAndCredentials, TokenCache> tokenCache = 
new HashMap<>();

Review Comment:
   It is great to see this feature added, but this should be made thread safe 
(e.g. by using `ConcurrentHashMap`) otherwise different threads may not see 
each others updates and in the worst case there can be an infinite loop during 
concurrent modification.



-- 
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: commits-unsubscr...@camel.apache.org

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

Reply via email to