Camel
  1. Camel
  2. CAMEL-4782

Add ManagedIdempotentConsumerBean with additional details such as duplicate detected

    Details

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

      Description

      It would be nice if this EIP had a specialized MBean which has details about number of duplicate detected.
      Then you can see this from management tooling or jconsole etc.

      People may use this EIP as a sort of fail safe to detect and discard duplicates. So it would be nice if we have stats in JMX we can expose.

      1. CAMEL-4782.patch
        13 kB
        Babak Vahdat
      2. CAMEL-4782-2.patch
        13 kB
        Babak Vahdat

        Activity

        Hide
        Babak Vahdat added a comment -

        Attached a potential patch for review (including unit-test). Please let me know if it's the way you would go for it or do you think of some other approaches. With [1] as the newest revision on the trunk, following the test results on camel-core:

        Results :

        Tests run: 3978, Failures: 0, Errors: 0, Skipped: 0

        [INFO]
        [INFO] — maven-bundle-plugin:2.3.4:bundle (default-bundle) @ camel-core —
        [WARNING] Warning building bundle org.apache.camel:camel-core:bundle:2.10-SNAPSHOT : Did not find matching referal for !org.apache.camel.*
        [INFO]
        [INFO] — maven-shade-plugin:1.4:shade (default) @ camel-core —
        [INFO] Including com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.2 in the shaded jar.
        [INFO] Excluding org.slf4j:slf4j-api:jar:1.6.1 from the shaded jar.
        [INFO] Replacing original artifact with shaded artifact.
        [INFO] Replacing c:\dev\workspace\camel\camel-core\target\camel-core-2.10-SNAPSHOT.jar with c:\dev\workspace\camel\camel-core\target\camel-core-2.10-SNAPSHOT-sh
        aded.jar
        [INFO]
        [INFO] — maven-jar-plugin:2.2:test-jar (default) @ camel-core —
        [INFO] Building jar: c:\dev\workspace\camel\camel-core\target\camel-core-2.10-SNAPSHOT-tests.jar
        [INFO]
        [INFO] — ianal-maven-plugin:1.0-alpha-1:verify-legal-files (default) @ camel-core —
        [INFO] Checking legal files in: camel-core-2.10-SNAPSHOT.jar
        [INFO] Checking legal files in: camel-core-2.10-SNAPSHOT-tests.jar
        [INFO]
        [INFO] — maven-install-plugin:2.3.1:install (default-install) @ camel-core —
        [INFO] Installing c:\dev\workspace\camel\camel-core\target\camel-core-2.10-SNAPSHOT.jar to C:\Users\Babak\.m2\repository\org\apache\camel\camel-core\2.10-SNAPSH
        OT\camel-core-2.10-SNAPSHOT.jar
        [INFO] Installing c:\dev\workspace\camel\camel-core\dependency-reduced-pom.xml to C:\Users\Babak\.m2\repository\org\apache\camel\camel-core\2.10-SNAPSHOT\camel-
        core-2.10-SNAPSHOT.pom
        [INFO] Installing c:\dev\workspace\camel\camel-core\target\camel-core-2.10-SNAPSHOT-tests.jar to C:\Users\Babak\.m2\repository\org\apache\camel\camel-core\2.10-
        SNAPSHOT\camel-core-2.10-SNAPSHOT-tests.jar
        [INFO]
        [INFO] — maven-bundle-plugin:2.3.4:install (default-install) @ camel-core —
        [INFO] Installing org/apache/camel/camel-core/2.10-SNAPSHOT/camel-core-2.10-SNAPSHOT.jar
        [INFO] Writing OBR metadata
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD SUCCESS
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 26:31.083s
        [INFO] Finished at: Sun Dec 18 19:24:16 CET 2011
        [INFO] Final Memory: 27M/494M
        [INFO] ------------------------------------------------------------------------

        [1] http://svn.apache.org/viewvc?view=revision&revision=1220370

        Show
        Babak Vahdat added a comment - Attached a potential patch for review (including unit-test). Please let me know if it's the way you would go for it or do you think of some other approaches. With [1] as the newest revision on the trunk, following the test results on camel-core: Results : Tests run: 3978, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] — maven-bundle-plugin:2.3.4:bundle (default-bundle) @ camel-core — [WARNING] Warning building bundle org.apache.camel:camel-core:bundle:2.10-SNAPSHOT : Did not find matching referal for !org.apache.camel.* [INFO] [INFO] — maven-shade-plugin:1.4:shade (default) @ camel-core — [INFO] Including com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.2 in the shaded jar. [INFO] Excluding org.slf4j:slf4j-api:jar:1.6.1 from the shaded jar. [INFO] Replacing original artifact with shaded artifact. [INFO] Replacing c:\dev\workspace\camel\camel-core\target\camel-core-2.10-SNAPSHOT.jar with c:\dev\workspace\camel\camel-core\target\camel-core-2.10-SNAPSHOT-sh aded.jar [INFO] [INFO] — maven-jar-plugin:2.2:test-jar (default) @ camel-core — [INFO] Building jar: c:\dev\workspace\camel\camel-core\target\camel-core-2.10-SNAPSHOT-tests.jar [INFO] [INFO] — ianal-maven-plugin:1.0-alpha-1:verify-legal-files (default) @ camel-core — [INFO] Checking legal files in: camel-core-2.10-SNAPSHOT.jar [INFO] Checking legal files in: camel-core-2.10-SNAPSHOT-tests.jar [INFO] [INFO] — maven-install-plugin:2.3.1:install (default-install) @ camel-core — [INFO] Installing c:\dev\workspace\camel\camel-core\target\camel-core-2.10-SNAPSHOT.jar to C:\Users\Babak\.m2\repository\org\apache\camel\camel-core\2.10-SNAPSH OT\camel-core-2.10-SNAPSHOT.jar [INFO] Installing c:\dev\workspace\camel\camel-core\dependency-reduced-pom.xml to C:\Users\Babak\.m2\repository\org\apache\camel\camel-core\2.10-SNAPSHOT\camel- core-2.10-SNAPSHOT.pom [INFO] Installing c:\dev\workspace\camel\camel-core\target\camel-core-2.10-SNAPSHOT-tests.jar to C:\Users\Babak\.m2\repository\org\apache\camel\camel-core\2.10- SNAPSHOT\camel-core-2.10-SNAPSHOT-tests.jar [INFO] [INFO] — maven-bundle-plugin:2.3.4:install (default-install) @ camel-core — [INFO] Installing org/apache/camel/camel-core/2.10-SNAPSHOT/camel-core-2.10-SNAPSHOT.jar [INFO] Writing OBR metadata [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 26:31.083s [INFO] Finished at: Sun Dec 18 19:24:16 CET 2011 [INFO] Final Memory: 27M/494M [INFO] ------------------------------------------------------------------------ [1] http://svn.apache.org/viewvc?view=revision&revision=1220370
        Hide
        Babak Vahdat added a comment -

        Attached a new copy of the provided patch with some more code-polishment.

        Show
        Babak Vahdat added a comment - Attached a new copy of the provided patch with some more code-polishment.
        Hide
        Claus Ibsen added a comment -

        Yeah the runnable is the poor mans closure.

        I wonder if we should just keep the stats in the EIP processors directly, and the from the mbean, invoke the getXXX method from the processor?

        The performance stats however is kept in the PerformanceMBean. So I understand that keeping stats in the MBean to make it similar.

        Lets ponder a bit about this.

        Show
        Claus Ibsen added a comment - Yeah the runnable is the poor mans closure. I wonder if we should just keep the stats in the EIP processors directly, and the from the mbean, invoke the getXXX method from the processor? The performance stats however is kept in the PerformanceMBean. So I understand that keeping stats in the MBean to make it similar. Lets ponder a bit about this.
        Hide
        Babak Vahdat added a comment -

        O.K. I did the way of your proposal and indeed that seems much better to me as well (see the second patch). But now as you see, we've got a trade-off situation here, that's we still keep counting the duplicate message count even if JMX is disabled! However we may want to argue that in the future there'll be probably API clients other than JMX who may want to make usage of the provided getDuplicateMessageCount() & resetDuplicateMessageCount() API offered directly by the IdempotentConsumer EIP processor.

        Show
        Babak Vahdat added a comment - O.K. I did the way of your proposal and indeed that seems much better to me as well (see the second patch). But now as you see, we've got a trade-off situation here, that's we still keep counting the duplicate message count even if JMX is disabled! However we may want to argue that in the future there'll be probably API clients other than JMX who may want to make usage of the provided getDuplicateMessageCount() & resetDuplicateMessageCount() API offered directly by the IdempotentConsumer EIP processor.
        Hide
        Babak Vahdat added a comment -

        Claus,

        What do you think about this second approach?

        Show
        Babak Vahdat added a comment - Claus, What do you think about this second approach?
        Hide
        Babak Vahdat added a comment -

        Claus,

        What do you think about this second approach?

        Show
        Babak Vahdat added a comment - Claus, What do you think about this second approach?
        Hide
        Claus Ibsen added a comment -

        I have been busy today tracking down a leak.

        I suggest to post a mail on @dev as we may look for more feedback for a good way to store EIP statistics and how to expose those from JMX and in the future REST management APIs.

        Show
        Claus Ibsen added a comment - I have been busy today tracking down a leak. I suggest to post a mail on @dev as we may look for more feedback for a good way to store EIP statistics and how to expose those from JMX and in the future REST management APIs.
        Show
        Babak Vahdat added a comment - I put the question for further discussion [1] onto the @dev. [1] http://camel.465427.n5.nabble.com/DISCUSS-How-to-better-enlist-the-duplicate-message-count-by-the-IdempotentConsumer-on-JMX-td5123118.html
        Hide
        Babak Vahdat added a comment -

        Didn't get much of feedback I was looking for @dev. However the second patch provided seems reasonable to me.

        Do you agree on applying it?

        Show
        Babak Vahdat added a comment - Didn't get much of feedback I was looking for @dev. However the second patch provided seems reasonable to me. Do you agree on applying it?
        Hide
        Claus Ibsen added a comment -

        Yeah the 2nd patch is nicer.

        Show
        Claus Ibsen added a comment - Yeah the 2nd patch is nicer.
        Hide
        Babak Vahdat added a comment -

        Applied my provided second patch (attached to this ticket) both into the trunk as well as 2.9.x branch.

        Show
        Babak Vahdat added a comment - Applied my provided second patch (attached to this ticket) both into the trunk as well as 2.9.x branch.

          People

          • Assignee:
            Babak Vahdat
            Reporter:
            Claus Ibsen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development