FAQ
Hello friends

I have implemented a idempotent consumer which filter's out duplicates.

Implemented it using MemoryIdempotentRepository implementation.

However, I feel that if the server runs over a long period of time, it must
eventually run out of memory after storing all the filter keys for a long
period of time.

Is there a way we can clear the Memory Idempotent Repository after a certain
period of time? Or is there an API which I can call and get it cleared from
the memory?

Cheers
Reji



-----
Reji Mathews
Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel & Jboss Fuse ESB | Mule ESB )
LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
Twitter - reji_mathews
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-MemoryIdempotentRepository-based-Idempotent-Consumer-tp5771668.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Raul Kripalani at Sep 18, 2015 at 4:46 pm
    Hi Reji,

    I would suggest you use a local cache implementation with an entry TTL or
    FIFO eviction support with a maximum limit on entry count.

    I find myself using Guava caches quite often when I require a lightweight
    cache [1] like what you describe.

    Beware that the content of the repository will not survive Camel context
    restarts, or a restart of anything further down the stack (app server,
    container, machine, etc.), but I guess you already are onto that since
    you're specifically using a Memory-based idempotent repo.

    [1] https://github.com/google/guava/wiki/CachesExplained

    Regards,

    *Raúl Kripalani*
    Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
    Integration specialist
    http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
    http://blog.raulkr.net | twitter: @raulvk
    On Fri, Sep 18, 2015 at 5:40 PM, contactreji wrote:

    Hello friends

    I have implemented a idempotent consumer which filter's out duplicates.

    Implemented it using MemoryIdempotentRepository implementation.

    However, I feel that if the server runs over a long period of time, it must
    eventually run out of memory after storing all the filter keys for a long
    period of time.

    Is there a way we can clear the Memory Idempotent Repository after a
    certain
    period of time? Or is there an API which I can call and get it cleared from
    the memory?

    Cheers
    Reji



    -----
    Reji Mathews
    Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel
    & Jboss Fuse ESB | Mule ESB )
    LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
    Twitter - reji_mathews
    --
    View this message in context:
    http://camel.465427.n5.nabble.com/Camel-MemoryIdempotentRepository-based-Idempotent-Consumer-tp5771668.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Contactreji at Sep 18, 2015 at 7:19 pm
    Hey Raul

    Thanks for that.

    I was checking out your way of doing it on
    http://camel.apache.org/idempotent-consumer.html ..
    Couldn't find a way to use cache though.

    Can you paste a code snippet of the implementation if you have any. That
    would be a big help for me to proceed!

    Cheers
    Reji



    -----
    Reji Mathews
    Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel & Jboss Fuse ESB | Mule ESB )
    LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
    Twitter - reji_mathews
    --
    View this message in context: http://camel.465427.n5.nabble.com/Camel-MemoryIdempotentRepository-based-Idempotent-Consumer-tp5771668p5771671.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Raul Kripalani at Sep 18, 2015 at 8:53 pm
    Ah, by the way, our MemoryIdempotentRepository has a size property. So you
    can set the max size of the cache without having to resort to another
    implementation.

    Try that first... We do not support time-based expiry or TTL though. If
    you're looking for that, you can implement IdempotentRepository and use a
    Guava cache (for example) to provide the functionality.

    Regards,
    Raúl.
    On 18 Sep 2015 20:19, "contactreji" wrote:

    Hey Raul

    Thanks for that.

    I was checking out your way of doing it on
    http://camel.apache.org/idempotent-consumer.html ..
    Couldn't find a way to use cache though.

    Can you paste a code snippet of the implementation if you have any. That
    would be a big help for me to proceed!

    Cheers
    Reji



    -----
    Reji Mathews
    Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel
    & Jboss Fuse ESB | Mule ESB )
    LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
    Twitter - reji_mathews
    --
    View this message in context:
    http://camel.465427.n5.nabble.com/Camel-MemoryIdempotentRepository-based-Idempotent-Consumer-tp5771668p5771671.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedSep 18, '15 at 4:41p
activeSep 18, '15 at 8:53p
posts4
users2
websitecamel.apache.org

2 users in discussion

Contactreji: 2 posts Raul Kripalani: 2 posts

People

Translate

site design / logo © 2021 Grokbase