Using the Infinispan based idempotent repository - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

In this section we will use the Infinispan based idempotent repository.

First, we need to create a cacheManager and then configure our org.apache.camel.component.infinispan.processor.idempotent.

InfinispanIdempotentRepository:

<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" 
init-method="start" destroy-method="stop"/>
<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.processor.idempotent.
InfinispanIdempotentRepository"
      factory-method="infinispanIdempotentRepository">
    <argument ref="cacheManager"/>
    <argument value="idempotent"/>
</bean>

Then we can create our Infinispan idempotent repository in the spring XML file as well:

<camelContext xmlns="http://camel.apache.org/schema/spring">   
    <route id="JpaMessageIdRepositoryTest">
        <from uri="direct:start" />
        <idempotentConsumer messageIdRepositoryRef="infinispanStore">
            <header>messageId</header>
            <to uri="mock:result" />
        </idempotentConsumer>
    </route>
</camelContext>