Skip to content
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

spring.config.import configuration option doesn't support Spring Retry #703

Closed
sergey-morenets opened this issue Jan 27, 2021 · 11 comments
Closed
Projects
Milestone

Comments

@sergey-morenets
Copy link

Spring Cloud Consul Config always supported Spring Retry and there's a special consulRetryInterceptor bean in RetryConfiguration class (part of ConsulAutoConfiguration class).

Spring Boot 2.4 introduced new property - spring.config.import which we can use to specify Consul Config client settings:

spring:
  config:
    import: "consul:localhost:8500;app"

But it seems new approach doesn't support Spring Retry by two reasons:

  1. consulRetryInterceptor bean loaded after spring.config.import configuration had been processed
  2. There's no @retryable methods in this new approach. ConsulPropertySourceLocator (which contains @retryable methods) is not used

The first issue can be resolved by creating custom high-order EnvironmentPostProcessor. But the second issue seems unsolvable for now.

Please advice on how to use Spring Retry and spring.config.import together.

@spencergibb
Copy link
Member

yes, this was left out do to timing. It was done in spring cloud config so it is possible.

@sergey-morenets
Copy link
Author

sergey-morenets commented Jan 27, 2021

Thank you, @spencergibb
So the only way now to use Spring Retry in Spring Cloud Consul Config is to use legacy configuration approach with bootstrap.yml?

@spencergibb
Copy link
Member

for now, using bootstrap will get you retry support.

@sergey-morenets
Copy link
Author

for now, using bootstrap will get you retry support.

Great. Can you please update documentation that Spring Retry is not supported with spring.config.import option now?
I was under impression it is supported and spent a lot of time on the investigation.

https://docs.spring.io/spring-cloud-consul/docs/current/reference/html/index.html#spring-cloud-consul-retry

@spencergibb
Copy link
Member

I can't update the docs since they are part of the release, but I will add something to the known issues section of the release notes

@spencergibb
Copy link
Member

Note added here https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2020.0-Release-Notes#known-issues

@sergey-morenets
Copy link
Author

Thank you, @spencergibb
Unfortunately I can't use "legacy" way because of another issue that I found: spring-cloud/spring-cloud-commons#893

@spencergibb spencergibb added this to To do in 2020.0.2 via automation Mar 16, 2021
@spencergibb spencergibb moved this from To do to Done in 2020.0.2 Mar 16, 2021
@spencergibb spencergibb added this to the 3.0.2 milestone Mar 16, 2021
@sergey-morenets
Copy link
Author

@spencergibb Thank you for the fix.
Do you have estimation for 3.0.2 release date?

@spencergibb
Copy link
Member

@hannah23280
Copy link

https://github.com/spring-cloud/spring-cloud-release/milestones

Hi, can i say that after the fix, this is resolved. I am currently 2020.0.3, but yet the retry still not working.

@spencergibb
Copy link
Member

@hanct I'm not sure I understand. This issue was to support retry with spring.config.import with consul. Either it works or it doesn't.
If you'd like us to spend some time investigating, please take the time to open a new issue and provide a complete, minimal, verifiable sample (something that we can unzip attached to the new issue or git clone, build, and deploy) that reproduces the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
2020.0.2
  
Done
Development

No branches or pull requests

4 participants