Reload CamelContext or routes on spring cloud config update

840 Views Asked by At

I am using camel 3.1.0 with spring boot 2.2.6. I have externalise configuration and spring cloud bus is being used to read config data from Git.

When I start application, it gets the the config (properties) from git via spring cloud bus, but when I update the config on git and invoke actuator/bus-refresh endpoint, changes not picked by the camel route in the spring boot application, though I see in logs that application receives the updated value of the property.

Is there anything I need to add as properties to let Spring boot to refresh the camel context on spring cloud bus event ?

1

There are 1 best solutions below

0
On

It seems that Camel doesn't support the configuration reloading as provided by Spring Cloud Config and there's no plan to add it, as written here: https://issues.apache.org/jira/browse/CAMEL-13892

On configuration update, a RefreshScopeRefreshedEvent event is sent by Spring Cloud. You might add some custom logic listening to that event and explicitly reloading the Camel components.