Spring Cloud with Archaius
Asked Answered
V

0

6

I'm having a hard time to understand how to use Netflix Archaius with Spring Boot Config.

I have a a microservice that gets the configuration from a Spring Cloud Config Server but I would like to have the configuration automatically refreshed when it is changed. As I understand this can be achieved with Archaius in the client side by pulling the info from the repository.

I have searched but cannot find a tutorial or example where this is done.

Vieva answered 19/5, 2015 at 14:21 Comment(6)
In case anyone is interested, I finally used spring-cloud-bus to propagate the refresh command to all the micro-services.Vieva
Hi Oreste, I'm having the same problem. Did you manage to use spring cloud config server + Archaius? There's zero documentation about it :(Kinghorn
Hello WornOutSoles, I did not use Config Server + Archaius. Only the config server by it self. As far as I know the only way to update the data on the services is to pull it from the config service. This can be done by adding the @RefreshScope annotation to the beans and then either calling the /refresh endpoint (on the client side) or calling the /bus/refresh if using Spring Cloud Bus. Also you can schedule refresh interval within the client application.Vieva
Hi! thanks for the info. I had read about the `/refresh' endpoint, but nothing about scheduling a refresh. Could you please tell me how to do that?Kinghorn
Hi, even though you can do schedule for the properties to be refreshed this is not the recommended way. Have a look here: http://projects.spring.io/spring-cloud/spring-cloud.html#_environment_changes and here https://github.com/spring-cloud/spring-cloud-config/issues/139Vieva
Thanks again!, I'll have a look at the links.Kinghorn

© 2022 - 2024 — McMap. All rights reserved.