Reputation: 1348
We need to use a third party scheduler with Camel Spring Boot. We can build the Spring Boot Jar and give the command to the external scheduler to invoke:
java -jar app-name.jar
The issue is that, we will never know when to return the control back to the external scheduler once the processing is completed (it should not stop in between, but should stay alive as long as the complete processing is done).
In Camel Spring Boot, we use the following property to keep the route threads alive:
camel.springboot.main-run-controller=true
If we make the above property false, Camel will shut down even before the processing is completed. If it is true, Camel will stay alive indefinitely and the scheduler will not be able to shut down Camel process once completed.
Appreciate any help with this.
Upvotes: 1
Views: 350
Reputation: 8203
I think what you are looking is shutdown your spring boot app after one message is processed. Try this
camel.springboot.main-run-controller=true
camel.springboot.duration-max-messages=1
Or
camel.springboot.main-run-controller=true
camel.springboot.duration-max-idle-seconds=30
Upvotes: 1