L.S.,
Since you're already using Camel, you might want to consider building
your own polling endpoint/consumer for this. The easiest way to go
about this would be to extend the corresponding base classes
DefaultPollingEndpoint/DefaultPollingConsumer. This would allow you to
use your own poller in the from(...) of your Camel route. This way,
Camel could manage the threading for you and you can just deploy your
route to servicemix-camel without having to worry about these issues.
Gert
Hamlet84 wrote:
Hi. in my application i have to start a thread that periodically check the db
and do something.
Now, to start the thread i'm using the camel-context.xml
<bean id="testDeamon" class="xxx.TestDeamon">
<property name="context" ref="camel"/>
</bean>
so i have also the camel context in my thread. When the thread is creating,
it's call this.start. To keep always alive, in the run method i use
while (true) {
...
}
the problem is that when i uninstall my application from container (deleting
the zip file from hotdeploy) the thread still alive.
There is an property on camel context (ex. context.isAlive()) that i can
check to stop the thread?
Or i have to add a listener on context lifecycle?
Many thanks :D