Reputation: 35
I'm trying to configure a standalone spring-camel application so that there is a route, and if no messages are received on that route for x seconds, the whole context will shutdown.
Let's say x is 10, if no message is received for 8 seconds, but then one arrives on the route, the counter should reset to 10 seconds. Once the counter reaches 0, the whole app should exit (gracefully, finishing whatever routes are currently processing)
If messages keep coming within the 10 seconds, the app should never exit.
Does anyone know an elegant way to achieve this?
Upvotes: 1
Views: 840
Reputation: 55750
If you use latest Camel release 2.19.1, you can then configure it to terminate after X messages, X time, or being idle for more than X seconds.
You can find the options in the camel spring configuration, which you can configure in application.properties
for Spring, such as
Upvotes: 3