THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
from("direct:start") .setHeader(InfinispanConstants.OPERATION, constant(InfinispanConstants.GET)) .setHeader(InfinispanConstants.KEY, constant("123")) .to("infinispan://localhost?cacheContainer=#cacheContainer"); |
Using the Infinispan based idempotent repository
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:
Code Block | ||||
---|---|---|---|---|
| ||||
<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:
Code Block | ||||
---|---|---|---|---|
| ||||
<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>
|
In c
For more information, see these resources...
...