Skip to content

Commit 4a773bd

Browse files
committed
Add note about potential resource exhaustion when Client is not singleton in FeignClientFactoryBean
Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
1 parent 74ffd3c commit 4a773bd

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)