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.

@ryanjbaxter
Copy link
Contributor

Please remove the extra character returns

…ntial resource exhaustion

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@98001yash 98001yash force-pushed the fix-client-creation-rctp branch from a5303ee to 400e004 Compare March 4, 2026 03:12
@98001yash
Copy link
Author

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

@ryanjbaxter
Copy link
Contributor

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

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.

3 participants