Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7712

camel-scala - Route id not set when using onException definition

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.13.2
    • 2.12.5, 2.13.3, 2.14.0
    • camel-scala
    • None
    • Unknown

    Description

      Given this route:

      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
        }
        
      }
      

      On startup we can see a my-route id:

      [main] DefaultCamelContext INFO Route: my-route started and consuming from: Endpoint[direct://input]
      

      Adding an onException definition to the route:

        handle[FileNotFoundException] {
          to("mock:exception")
        }.handled
      

      On startup we can see a route1 id:

      [main] DefaultCamelContext INFO Route: route1 started and consuming from: Endpoint[direct://input]
      

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            edinhodzic Edin Hodzic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: