Camel
  1. Camel
  2. CAMEL-4496

IdempotentConsumer EIP - Add option to control if it should undo on failure or not

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Moderate

      Description

      We need a new option on Idempotent Consumer EIP.

      Boolean undoOnFailure

      Which should act default as "true".

      This allows end users to control that in case the Exchange failed, then the idempotent consumer should either
      keep the id in the repository, or undo adding the id (the current behavior).

      Some users have reasons for the idempotent consumer to not accept a redelivery of a previously failed exchange.

      1. CAMEL-4496-patch.txt
        20 kB
        Ioannis Canellos

        Activity

        Hide
        Ioannis Canellos added a comment -

        Patch committed and documentation has been updated.

        Show
        Ioannis Canellos added a comment - Patch committed and documentation has been updated.
        Hide
        Claus Ibsen added a comment -

        Thanks for the patch.

        I had to fix a minor typo in one of the javadocs.
        I adjusted the unit test to test for the non-default setting which would be removeOnFailure=false. You had the test for =true.
        Likewise I adjusted the unit test in camel-spring to extend the unit test from camel-core.

        Take a look at the commit log, for how this can be done.

        Ioannis do you mind updating the wiki page of the idempotent consumer EIP with this new option.

        Show
        Claus Ibsen added a comment - Thanks for the patch. I had to fix a minor typo in one of the javadocs. I adjusted the unit test to test for the non-default setting which would be removeOnFailure=false. You had the test for =true. Likewise I adjusted the unit test in camel-spring to extend the unit test from camel-core. Take a look at the commit log, for how this can be done. Ioannis do you mind updating the wiki page of the idempotent consumer EIP with this new option.
        Hide
        Ioannis Canellos added a comment -

        I am attaching a patch, which adds the property removeOnFailure on the idempotent consumer. Also adds a unit test in camel-core and camel-spring to test the use of the property from java dsl and spring.

        Show
        Ioannis Canellos added a comment - I am attaching a patch, which adds the property removeOnFailure on the idempotent consumer. Also adds a unit test in camel-core and camel-spring to test the use of the property from java dsl and spring.
        Hide
        Charles Moulliard added a comment -

        A better name for this option could be "removeOnFailure" as the idea is to remove (or not) the exchange from the cache of the idempotentConsumer

        Show
        Charles Moulliard added a comment - A better name for this option could be "removeOnFailure" as the idea is to remove (or not) the exchange from the cache of the idempotentConsumer

          People

          • Assignee:
            Ioannis Canellos
            Reporter:
            Claus Ibsen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development