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

Predicates are shared between templated routes in Java DSL with simple predicate builder

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Information Provided
    • 3.20.4
    • 4.0-RC2, 4.0.0
    • came-core
    • None
    • Unknown

    Description

      Templated routes with the "choice" processor share the same Predicate (org.apache.camel.model.WhenDefinition#expression#predicate) and because it is initialized with template parameters of the first route created, it fails for the other routes. This is particularly visible when using Kamelets.

      The proposed solution would be for org.apache.camel.model.WhenDefinition to accept Supplier<Predicate> (or similar) instead of the Predicate instance but that would require static factory methods in org.apache.camel.support.builder.PredicateBuilder to be refactored or a new class to be created.

      This is a unit test. It fails for the second instance of the template.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            bartoszpop Bartosz Popiela
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: