There is a skipDuplicate option on the idempotent consumer in Camel 2.8.
Then you can turn that option off, and then a filter EIP to filter the
duplicates and lookup the value from the cache and return that.

The EIPs can often be combined together to form new patterns (kinda
like lego bricks style)

On Tue, Jun 21, 2011 at 3:10 PM, mcaserta <[email protected]> wrote:
> I was thinking of wiring into Camel something that can be used like this:
>
> from("webservice")
>            .cachingConsumer(header("myMessageId"),
>                    InMemoryRepository.inMemoryRepository(200))
>            .bean("myProcessor");
>
> This should work like this:
>
> - if the repository contains the key, the value is returned and further
> route processing is skipped
> - if the repository does not contain the key, further route processing
> occurs and (this is the tricky part I guess) at the end of the route the
> answer is stored in the repository
>
> This would simplify a lot the otherwise necessary route made using a caching
> component such as hazelcast.
>
> What do you think?
>
> Ciao, Mirko.
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Idempotent-consumer-question-tp4510383p4510515.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to