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

Templated route exception handling not working

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.18.0
    • 3.18.1, 3.19.0
    • came-core
    • None
      • Camel 3.18.0
      • Spring-boot 2.7.1
      • OpenJDK 11
      • Maven 3.5.0
    • Unknown

    Description

      Using Route Templates as described here in the Camel docs: route-template, I cannot get any exception handling to work unless I define it within the class that is constructing the template itself.
      Specifically,  trying to use global exception handling in the class that calls TemplatedRouteBuilder.builder() to build a route from my template. Expected exceptions are not caught.
      And there is no .onException() method implementation to customize the handling that could be called in the list of fluent methods starting with TemplatedRouteBuilder.build().

      I have already posted this, with my example code, in the Camel mailing list. Please have a look at the discussion here: [mail-archive|https://lists.apache.org/thread/26kp2tpfbgj9mxpfdr106f36xyj51d7g]

      This is the hi-level description from that mail article:

      Hi-level overview:
      - 2 projects: 1 camel template base jar and 1 springboot camel application (that builds its route using the template from the other project).
      - the base jar builds a route template
      - the application jar builds a route using the template from the base jar
      - the desire here is to do some extra customization in the application (at templated-route creation time) to setup extra exception handling that is not included in the base template.
      - I have also tried to define global level exception handling using onException() in my application project's configure() method. But this is not catching anything either.
       

      There is a overview of the code in the mail article as well. But I also have a simplified single spring-boot test project with junit that I can provide if needed.

      Attachments

        1. camel-template-so.7z
          2 kB
          j vh
        2. camel-template-so.zip
          29 kB
          Rhuan Rocha

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jvh j vh
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: