apache-camelquarkus

How to recover from startup failure in Camel Quarkus?


"Vanilla" Apache Camel has the RouteController with the option of supervising routes, so that one may catch failing routes instead of letting entire Camel go down (which is default behaviour). In Camel Quarkus, I am not sure how it is possible to handle route startup failure, since everything is a tad more high-level. I have been googling like a madman, but no avail, sadly. Any hints on how to tackle this?

More specifically: I have multiple WebSocket connections that might or might not be active when initializing the Camel Quarkus integration microservice, but I'd like the latter to keep trying until they are back up again instead of crashing the whole app.


Solution

  • Route Controller and 'supervised' routes can be used on Camel Quarkus. You can configure camel.routecontroller properties in application.properties. There's an example project that demonstrates this here:

    https://github.com/apache/camel-quarkus-examples/tree/main/health

    The relevant part of the application configuration is here:

    https://github.com/apache/camel-quarkus-examples/blob/main/health/src/main/resources/application.properties#L30-L40