Unfortunately its not the repository I've extended, its the consumer itself. On Feb 11, 2014 10:30 PM, "Christian Müller" <christian.muel...@gmail.com> wrote:
> Instead of > <bean id="myRepo" > class="org.apache.camel.processor.idempotent.MemoryIdempotentRepository"/> > > you should configure your own IdempotentRepository. > > 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 10:59 PM, Sam Adams <sbad...@gmail.com> wrote: > > > Hi, > > > > Unless I am mistaken this just adds a the standard IdempotentConsumer to > > the route? This would remove messages with duplicate keys indefinatly. I > > only want to remove them while the duplicate message is being processed. > > > > Or am I missing something? > > > > Thanks, > > > > Sam > > > > > > On 11 February 2014 21:43, Christian Müller <christian.muel...@gmail.com > > >wrote: > > > > > 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 <sbad...@gmail.com> 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 > > > > > > > > > >