camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Custom Idempotent Jdbc repository + Using lastmodified time
Date Tue, 18 Sep 2012 07:11:13 GMT
On Tue, Sep 18, 2012 at 7:25 AM, Siano, Stephan <> wrote:
> There are actually two potential usages for idempotent repositories in conjunction with
(S)FTP endpoints: usage in the endpoint itself or with an idempotent consumer in the pipeline
(as you describe). If you have the idempotent repository directly in the endpoint this has
the advantage that it is applied before the file is even fetched from the server, however
AFAIK the only available information for this is the filename. With idempotent consumers in
the pipeline, you are free to do whatever you want, but this is after you have fetched the
file from the server.
> So to answer the original question: AFAIK there is no way to put any exchange properties
to an idempotent repository that is attached to the endpoint using the idempotentRepository
parameter in the file/FTP/SFTP endpoint, because there is actually no exchange at the time
it is used. If you are willing to download all files and then select which ones you want to
process, the idempotent consumer Christian described is the way to go.

Yes the built-in idempotent consumer is based on the file name only.
We could enhance this with more details if that would be possible.

Fell free to log a JIRA ticket.

> Best regards
> Stephan
> -----Original Message-----
> From: Christian Müller []
> Sent: Montag, 17. September 2012 23:57
> To:
> Subject: Re: Custom Idempotent Jdbc repository + Using lastmodified time
> Checkout: and
> Instead of
> from("direct:a")
>     .idempotentConsumer(header("myMessageId"), ...
> try something like
> from("direct:a")
> .idempotentConsumer(simple("${header.CamelFileNameOnly}-${header.CamelFileLastModified}"),
> ...
> Best,
> Christian
> On Mon, Sep 17, 2012 at 11:34 PM, webber78 <> wrote:
>> Thanks for your reply. Is there anyway I can get the header you described
>> in
>> a subclass of AbstractJdbcMessageIdRepository. I saw a few examples of
>> getting headers using the Exchange object, but not sure how to get access
>> to
>> these from an idempotent repository.
>> Thanks,
>> Kiran
>> --
>> View this message in context:
>> Sent from the Camel - Users mailing list archive at
> --

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message