Usage of Hazelcast or infinispan for idempotent routes ?

Solution Unverified - Updated -

Issue

  • We have a publish and subscribe architecture based on topics, running in a clustered environment. The topic subscriber route must not be called more then once. We wanted to use the idempotency feature for this, by using Hazelast, because it is suited for a clustered environment. But there is no sample in the documentation and the internet which shows how to use the Hazelcast idempotent repository. Please send me an blueprint example showing how to avoid duplicate calls of routes with Hazelcast.
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
       http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
       http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">

    <bean id="siamIdempotentRepository" class="org.apache.camel.processor.idempotent.hazelcast.HazelcastIdempotentRepository"></bean> 

    <routeContext id="topic2RequirementTrouxRouteContext"
        xmlns="http://camel.apache.org/schema/blueprint">
        <route id="topic2RequirementTroux">
            <from uri="activemq:topic:project" ></from>
                <idempotentConsumer messageIdRepositoryRef="hazelcast">
                <header>id</header>
                    <log message="Here I am ..."></log>
                    <to uri="mock:ready" ></to>
                </idempotentConsumer>
        </route>
    </routeContext>
</blueprint>


  • Is Hazelcast the only option, can we not use camel-infinispan component for use in such cases ?

Environment

  • Red Hat JBoss Fuse
    • 6.x
  • Apache Camel

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.