How to monitor Apache Camel status?
I have already working Camel configuration that is watching a database table (through spring and hibernate), and when something shows up in DB, Camel consumes it and sends message to JMS broker.
This works flawlessly. And is built in DSL in MyOwnMessageRouteBuilder.configure()
Now I'd like to add monitoring that do something if no new data shows up in DB i开发者_JAVA百科n given (like 3h) time. Is that possible in Camel at all? I can see callbacks like onCompletion or onException, but nothing like onIdle()....
Best regards
You may look at BAM http://camel.apache.org/bam
However usually some monitoring tooling may already be able to do this, and thus you may be able to find a generic solution.
I think your best best is to use a timer/quartz route to check the database periodically and compare the timestamp of the most recent data vs. current time...if its greater than 3h old, then react accordingly...
精彩评论