Reputation: 51
Hi I am using apache camel timer component in my route. I need to change the period polling interval dynamically. I have a business method which will return some time interval and it will be different depending on logic. I have to pass this to Timer so that my timer should poll according to this interval. I don't want to start and stop the route with new interval as its performance hit. I want one timer route for which period has to be set dynamically.
Upvotes: 1
Views: 1903
Reputation: 55540
The timer cannot be changed at runtime, as its using the JDK java.util.Timer which cannot be changed.
You can use camel-quartz which allows changing the scheduler at runtime, which you can do using JMX. There is also a Quartz plugin in hawtio - http://hawt.io/plugins/quartz/ - that allows you to change the scheduler using a web UI.
Upvotes: 1