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

Property camel.springboot.java-routes-exclude-pattern not working correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.3.0
    • Component/s: camel-spring-boot
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Hi,

      I believe that the property camel.springboot.java-routes-exclude-pattern is not being applied correctly. Given two classes Route1 and Route2 (both annotated with spring boot's Component annotation) and the pattern "**/Route2*", I would expect to see only Route1 being picked up and started, but I see both routes being started when I run the application. It seems that only Route1 component can be excluded if the pattern matches that class. 

       

      The reason for that seems to be in the class  org.apache.camel.spring.boot.SpringBootRoutesCollector. It receives the exclude pattern as a parameter in the method collectRoutesFromRegistry, but at some point replaces it with the value of the property CamelTestSpringExcludeRoutes. The original pattern can only be matched against the first component route registered in spring boot Application Context.

       

      I have attached a sample application showing the situation. If I am misunderstanding something, please let me know.

       

      Thanks!

        Attachments

        1. demo.zip
          57 kB
          Marcelo Nardelli

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              mnardelli Marcelo Nardelli
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: