See [1] for details.

<bean id="myRepo"
class="org.apache.camel.processor.idempotent.MemoryIdempotentRepository"/>

<camelContext xmlns="http://camel.apache.org/schema/spring";>
    <route>
        <from uri="direct:start"/>
        <idempotentConsumer messageIdRepositoryRef="myRepo">
            <!-- use the messageId header as key for identifying duplicate
messages -->
            <header>messageId</header>
            <!-- if not a duplicate send it to this mock endpoint -->
            <to uri="mock:result"/>
        </idempotentConsumer>
    </route>
</camelContext>


[1] http://camel.apache.org/idempotent-consumer.html

Best,

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Tue, Feb 11, 2014 at 6:21 PM, Sam Adams <[email protected]> wrote:

> Hi,
>
> I want to extend the IdempotentConsumer to only deny duplicated while the
> duplicate message is being processed.
>
> My plan was to add an additional Synchronization that removed the messageId
> from the repository when the message has finished processing. However I
> can't find a simple example of how to add my version of the
> IdempotentConsumer to my route. I believe I could add it as a standard
> processor but I don't really know how to do this as doesn't have a no-args
> constructor.
>
> My other idea would be to add the additional Synchronization in the route
> directly, outside the IdempotentConsumer but I couldn't see a clean way of
> finding the messageId or the repository.
>
> Any help would be greatly appreciated.
>
> Thanks,
>
> Sam
>

Reply via email to