Skip to content

Commit d92cc04

Browse files
authored
Merge pull request #1356 from 98001yash/fix/feign-client-resource-exhaustion
Document potential resource exhaustion risk when Client is not singleton
2 parents ac487b7 + 4a773bd commit d92cc04

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignClientFactoryBean.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ <T> T getTarget() {
483483
if (StringUtils.hasText(url) && !url.startsWith("http://") && !url.startsWith("https://")) {
484484
url = "http://" + url;
485485
}
486+
// NOTE: The Client bean should ideally be configured as a singleton.
487+
// Repeated resolution of Client instances may lead to resource exhaustion
488+
// (e.g., connection pools, threads) if not properly managed.
486489
Client client = getOptional(feignClientFactory, Client.class);
487490
if (client != null) {
488491
if (client instanceof FeignBlockingLoadBalancerClient) {

0 commit comments

Comments
 (0)