0
votes

Looking for some help handling the error conditions that may occur during camel route(s) startup in a context. We are using java dsl to create routes after reading a configuration. when one of the configuration is wrong (e.g. missing host name in sftp uri. runtime discovery of error in this case), all subsequent routes are not even started by camel. What we are trying to achieve is, log an error for faulty case and proceed with subsequent route.

Is there any interceptor for same?

1

1 Answers

0
votes

I would need more information to provide you with a more exact answer; however, it looks like you should be able to use the onException clause as part of RouteBuilder configuration. Here is an excerpt from the JBoss Camel guide:

Scopes

The onException clauses can be effective in either of the following scopes: RouteBuilder scope—onException clauses defined as standalone statements inside a RouteBuilder.configure() method affect all of the routes defined in that RouteBuilder instance. On the other hand, these onException clauses have no effect whatsoever on routes defined inside any other RouteBuilder instance. The onException clauses must appear before the route definitions. All of the examples up to this point are defined using the RouteBuilder scope. Route scope—onException clauses can also be embedded directly within a route. These onException clauses affect only the route in which they are defined.

https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.1/html-single/Apache_Camel_Development_Guide/#BasicPrinciples-ExceptionHandling