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

Decouple restart functionality from actuator endpoint

Open maciejwalkowiak opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe.

In Spring Cloud AWS we are implementing restarting/refreshing context when properties loaded from Secrets Manager or Parameter Store change. Depending on the reload strategy chosen by users, we either refresh or restart the context. Because the restart functionality is baked into the RestartEndpoint, restarting must rely on the presence of the Spring Boot's actuator.

Checking for changes happens in the background thread without any action taken by the user like calling actuator endpoint.

https://github.com/awspring/spring-cloud-aws/blob/secretsmanager-reload/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/reload/ConfigurationUpdateStrategy.java#L44

Describe the solution you'd like

Decouple core restart functionality from RestartEndpoint making it possible to use in scenarios other than calling actuator endpoint even if restart endpoint is not enabled.

Describe alternatives you've considered

Currently we enable restart functionality only if actuator is present and restart endpoint is enabled (but I don't think this is a right way to go).

Additional context

Implementation is very much inspired by one in Spring Cloud Kubernetes so I think this change would benefit both projects.

maciejwalkowiak avatar Oct 16 '22 20:10 maciejwalkowiak