Announcement Announcement Module
Collapse
No announcement yet.
Asynchronous Queue - handling duplicates Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    @ajones

    Currently yes, but there will be messages from the outside as well.

    Comment


    • #17
      I think you may try Mark`s solution. It looks better than interceptors. Or you may use another adviсe:
      Originally posted by iwein View Post
      For deduplication I would look at Idempotent Receiver. This is not something implemented in the framework, as it can only be handled in the Receiver (which is your job to write).

      You could create a deduping filter that stores all messages it has seen and passes only ones it hasn't seen before, but that is an inherent memory leak, or with a timeout, it isn't fool proof.
      http://www.eaipatterns.com/IdempotentReceiver.html

      Comment


      • #18
        Mark, thanks! This is what I first was looking for. It should help. I have missed it out, it seems the 'ref' attribute was added to the schema after 1.0.2 SR1.

        Comment


        • #19
          @ajones

          Thanks, but the Idempotent Receiver isn't quite what I was after. Basically the access to the channel queue (ideally directly -- so the 'ref' attribute will help -- or at least via an internal cache in an interceptor) is needed to decide whether a message is a 'duplicate' (in a bit specific sense in this case) or not. While with an idempotent receiver the de-duplication is done after the channel. BTW in the latter case the channel may reach its capacity (filled with duplicate messages) and start discarding new incoming messages -- we can easily avoid this with an interceptor.

          Comment


          • #20
            Anna,

            Sorry the 'ref' will be available in version 1.0.3 (or the SVN head version).
            http://jira.springframework.org/browse/INT-634

            We are only a few days away.

            -Mark

            Comment


            • #21
              Mark, it's totally fine with me. Thank you!

              Comment


              • #22
                How about using a BlockingQueue implementation that doesn't allow duplicates for the QueueChannel? There is a reason that this isn't part of the JDK, I think (I haven't verified this yet), but you'd have to resolve the same concurrency problems you have with an interceptor, but within a single method invocation.

                The most important thing to ask first is: How bad would it be to have duplicates in the channel?

                Update: it seems I missed a page of replies there, sorry for the redundancy.

                Comment


                • #23
                  Iwein, thanks. Yes the impl with a custom queue should be simpler compared to the interceptor.

                  Comment

                  Working...
                  X