[
https://issues.apache.org/jira/browse/CAMEL-7712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14099940#comment-14099940
]
Claus Ibsen commented on CAMEL-7712:
------------------------------------
You need to use .routeId to set the id of the route
> Route id not set when using onException definition
> --------------------------------------------------
>
> Key: CAMEL-7712
> URL: https://issues.apache.org/jira/browse/CAMEL-7712
> Project: Camel
> Issue Type: Bug
> Components: camel-scala
> Affects Versions: 2.13.2
> Reporter: Edin Hodzic
> Priority: Minor
>
> Given this route:
> {code:title=MyRoute.scala}
> import org.apache.camel.main.Main
> import org.apache.camel.scala.dsl.builder.{RouteBuilder, RouteBuilderSupport}
> class MyRoute extends RouteBuilder {
> "direct:input" ==> {
> id("my-route")
> to("mock:output")
> }
> }
> object MyRoute extends RouteBuilderSupport {
> def main(args: Array[String]) {
> val main = new Main()
> main.enableHangupSupport
> main.addRouteBuilder(new MyRoute)
> main.run
> }
>
> }
> {code}
> On startup we can see a {{my-route}} id:
> {noformat}
> [main] DefaultCamelContext INFO Route: my-route started and consuming from:
> Endpoint[direct://input]
> {noformat}
> Adding an {{onException}} definition to the route:
> {code}
> handle[FileNotFoundException] {
> to("mock:exception")
> }.handled
> {code}
> On startup we can see a {{route1}} id:
> {noformat}
> [main] DefaultCamelContext INFO Route: route1 started and consuming from:
> Endpoint[direct://input]
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.2#6252)