You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ninadmnaik <nn...@gmail.com> on 2013/07/10 19:03:40 UTC
Can Camel pick up changes to a properties file at runtime?
Hello,
I am writing a simple module to FTP files to a remote server. I am using a
properties file to read the ftp info such as server, username, password etc.
ex: here's how my properties file looks like:
ftp.protocol=ftp
ftp.host=localhost:2121
ftp.path=files
ftp.username=admin
ftp.password=admin
ftp.client={{ftp.protocol}}://{{ftp.host}}/{{ftp.path}}?username={{ftp.username}}&password={{ftp.password}}&reconnectDelay=5000
Now, depending on the type of file, I want to change the "ftp.host",
"ftp.path" etc in the above snippet.
According to this post:
http://camel.465427.n5.nabble.com/Camel-Properties-Component-Cache-td5539115.html
camel will pick up the changes to properties file.
But this isn't working for me. So, does camel support this? Can changes to a
properties file be detected during runtime?
Here's how my camel context looks:
<camelContext id="camelContext"
xmlns="http://camel.apache.org/schema/spring">
<propertyPlaceholder id="properties" cache="false"
location="classpath:ftp.properties"
xmlns="http://camel.apache.org/schema/spring"/>
<routeBuilder ref="ftpRouteBuilder"/>
</camelContext>
I have also tried using PropertiesComponent in the configure method in the
RouteBuilder:
PropertiesComponent propertiesComponent =
getContext().getComponent("properties", PropertiesComponent.class);
propertiesComponent.setCache(false);
propertiesComponent.setLocation("classpath:ftp.properties");
Thanks a bunch !
--
View this message in context: http://camel.465427.n5.nabble.com/Can-Camel-pick-up-changes-to-a-properties-file-at-runtime-tp5735469.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Can Camel Route pick up changes to a properties file at
runtime?
Posted by ninadmnaik <nn...@gmail.com>.
Ok. So seems like routes can't be updated. But an existing route can be
deleted and a new route added at runtime.
http://camel.465427.n5.nabble.com/Update-camel-route-at-runtime-using-config-admin-td4965455.html
That kind of answers my question.
Thanks.
--
View this message in context: http://camel.465427.n5.nabble.com/Can-Camel-Route-pick-up-changes-to-a-properties-file-at-runtime-tp5735469p5735495.html
Sent from the Camel - Users mailing list archive at Nabble.com.