Skip to content

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

Open
98001yash wants to merge 1 commit intospring-cloud:mainfrom
98001yash:fix-client-creation-rctp
Open

Add defensive warning for multiple Feign Client beans to avoid potential resource exhaustion#1333
98001yash wants to merge 1 commit intospring-cloud:mainfrom
98001yash:fix-client-creation-rctp

Conversation

@98001yash
Copy link

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.

…ntial resource exhaustion

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@98001yash 98001yash force-pushed the fix-client-creation-rctp branch from 227d0c3 to a5303ee Compare February 24, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants