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

interceptSendToEndpoint with predicate and skip

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.9.0
    • 2.10.0
    • camel-core, camel-spring
    • None
    • Patch Available
    • Unknown

    Description

      The <when> clause in the interceptors behave like filters. This is okay with intercept and interceptFrom, where the only possible route manipulation is <stop />, which is expressed inside the routing block.

      However, with interceptSendToEndpoint there is one edge case that could cause ambiguity. When skipSendToEndpoint=true, along with a <when> clause, the user might expect that the skipping will only occur if the condition is met. However, it occurs always. The <when /> only determines whether the routing logic contained inside the body of the intercept block will occur or not.

      I propose to add a new attribute onlySkipWhenConditionMet, so that when this is true, the <when> clause will be evaluated to determine if the originally intended endpoint is actually skipped or not.

      Attachments

        1. test-interceptor.xml
          1 kB
          Raúl Kripalani
        2. interceptSendToEndpointConditionalSkip.diff
          18 kB
          Raúl Kripalani
        3. interceptSendToEndpointConditionalSkip_v2.diff
          19 kB
          Raúl Kripalani

        Activity

          People

            davsclaus Claus Ibsen
            raulvk Raúl Kripalani
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: