spring-cloud-openfeign icon indicating copy to clipboard operation
spring-cloud-openfeign copied to clipboard

Add defensive warning for multiple Feign Client beans to avoid potential resource exhaustion

Open yashdotdev13 opened this issue 9 months ago • 3 comments

This change adds a defensive warning in FeignClientFactoryBean#getTarget() to detect multiple Client beans defined within a Feign client context.

Although Feign clients are typically configured with singleton-scoped Client beans, misconfiguration (such as defining multiple or non-singleton Client beans) may lead to multiple underlying HTTP connection pools being created, potentially resulting in resource exhaustion.

This update does not modify lifecycle behavior or bean creation logic. It only adds a warning log to improve visibility and prevent accidental misuse.

Additionally, documentation has been updated to clarify that custom Client beans should be singleton-scoped.

yashdotdev13 avatar Feb 24 '26 10:02 yashdotdev13

Please remove the extra character returns

ryanjbaxter avatar Mar 02 '26 14:03 ryanjbaxter

Removed the extra character returns and reformatted the affected files. Please take another look. Thanks!

yashdotdev13 avatar Mar 04 '26 03:03 yashdotdev13

Now there are a ton of unnecessary formatting changes, checktyle is failing

ryanjbaxter avatar Mar 04 '26 10:03 ryanjbaxter