We are building an integration project using Apache Camel (Camel 2.10.3, Java DSL).
We have a route that retrieves data from a database (allows calling IN_DB), performs some logic and inserts into another database (OUT_DB) once a day, and another route that subscribes to the JMS topic for XML data does some logic and inserts it into the same database (OUT_DB) during the day.
The requirement is that when the connection on the JMS topic for any reason goes for any reason, we continue to try to reconnect indefinitely, and as soon as the reconnection is successful, we need to return to the database (IN_DB) and do another load to fill in the gap where the topic was omitted.
My question is, how can we make this logic ("I was connected and then disconnected, and now I am connected again") in Camel? What happens to a route that starts with a topic consumer, when the topic drops, does the route just stop? Or will he throw an error message in the error queue? Should I write my own handler to track the connection to the topic, or Camel will automatically connect when the topic returns and sets a message header, or set some context variable to indicate that "I was connected, then I disconnected and now I am connected again "did the script happen? I am happy to build route logic around a database load call. I just can't figure out how to best “detect” in Camel that this scenario happened.
Any suggestions that are very much appreciated.
java apache-camel jms
Matt
source share