Skip to content

build: Use spring-web instead of spring-webflux in spring-ai-retry #3308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

pkubowicz
Copy link
Contributor

The dependency on spring-webflux was unnecessary, there was no code inside spring-ai-retry that made use of it.

Also remove 'optional' from slf4j-api dependency (it's not optional, if you don't have it on classpath, RetryUtils will fail to load).

Fixes #3307

@markpollack
Copy link
Member

Thanks, great catch.

@ilayaperumalg
Copy link
Member

@pkubowicz Thanks for the PR! As you can see from the compilation issues with the build, the dependency web-flux is being used by a few other modules via spring-ai-retry. It appears that we need a better strategy in terms of defining common vs specific dependencies for the individual modules.

@pkubowicz
Copy link
Contributor Author

I don't think 'retry' module should be the place to decide on common dependencies. Especially, the decision on the web client library used should not be in a helper/tooling module like 'retry'.

Being explicit about dependencies is a well-known rule to build reusable publicly available libraries. Is it worth a discussion? To me, the fix is straightforward, and is to make the dependency on webflux explicit in each place using it. I was surprised the rule is not consequently applied to this repository, hence the compilation failure. But the fix should be easy, and if you don't have anything against, I will add it to my PR.

@ilayaperumalg
Copy link
Member

I don't think 'retry' module should be the place to decide on common dependencies. Especially, the decision on the web client library used should not be in a helper/tooling module like 'retry'.

I agree as that's exactly what you fixed in this.

Being explicit about dependencies is a well-known rule to build reusable publicly available libraries. Is it worth a discussion?
I marked this to "to discuss" for the team to identify any other similar dependencies and potentially move these common dependencies to their respective common/shared module.

Feel free to update the PR with your suggestion.

The dependency on spring-webflux was unnecessary, there was no code
inside spring-ai-retry that made use of it.

Also remove 'optional' from slf4j-api dependency (it's not optional,
if you don't have it on classpath, RetryUtils will fail to load).

Add explicit dependency on spring-webflux for modules that directly
import WebClient.

Fixes spring-projects#3307

Signed-off-by: Piotr Kubowicz <piotr.kubowicz@gmail.com>
@pkubowicz
Copy link
Contributor Author

I rebased on the current main and added the explicit dependency on spring-webflux where compilation failed without it.

@ilayaperumalg
Copy link
Member

Rebased and merged as cecc046

@pkubowicz pkubowicz deleted the retry-no-webflux branch June 10, 2025 13:26
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.

spring-ai-retry should not require spring-webflux dependency
4 participants