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

Spring Boot and CDI integration don't detect duplicate routes, should support earlier context configuration

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.14.1
    • 2.17.0
    • None
    • Unknown

    Description

      See discussion:

      http://mail-archives.apache.org/mod_mbox/camel-users/201502.mbox/%3C8713C0A9-5CB3-45AC-871F-F58ECC28C71E%40christianbauer.name%3E

      Most users in both Spring Booth and CDI environments probably rely on auto-discovery of routes, so duplicate route identifiers are a common mistake and should be detected. For this to work, routes have to be added before the CamelContext is started.

      This affects both Spring Boot and CDI integration, where the routes are added after CamelContext start, which results in replacement of duplicates without error.

      The CDI integration code is actually worse than the Spring Boot code, since users have no chance of customizing the CamelContext with a CamelContextConfiguration. In the Spring Boot integration there is at least that option available to access the CamelContext after it has started, although that still doesn't give you access to the important configuration options such as ManagementStrategy.

      I recommend in both Spring Boot and CDI integration to share a (new?) CamelContextConfiguration interface with methods beforeContextStart(CamelContxt ctx) and afterContextStart(CamelContext ctx). Instances of that type should be auto-discovered so the user has a chance to edit the CamelContext.

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              apache@christianbauer.name Christian Bauer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: