Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9883

Add a SpringCache based idempotent repository

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.17.1, 2.18.0
    • Component/s: camel-spring
    • Labels:
      None
    • Estimated Complexity:
      Novice

      Description

      It may be useful to have a spring-cache based idempotent repository to ease the configuration of idempotent repository in spring xml based projects.

      i.e.

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="
           http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd
           http://camel.apache.org/schema/spring
           http://camel.apache.org/schema/spring/camel-spring.xsd">
      
        <bean id="cacheManager" class="org.infinispan.spring.provider.SpringRemoteCacheManagerFactoryBean">
          <property
              name="configurationProperties">
            <props>
              <prop key="infinispan.client.hotrod.server_list">127.0.0.1:11222</prop>
              <prop key="infinispan.client.hotrod.force_return_values">true</prop>
            </props>
          </property>
        </bean>
      
        <bean id="repo" class="org.apache.camel-spring.SpringCacheIdempotentRepository">
          <constructor-arg ref="cacheManager"/>
          <constructor-arg value="idempotent"/>
        </bean>
      
        <camelContext xmlns="http://camel.apache.org/schema/spring">
          <route id="infinispan-remote">
            <from uri="direct:start" />
            <idempotentConsumer messageIdRepositoryRef="repo" skipDuplicate="true">
              <header>MessageId</header>
              <to uri="log:camel?level=INFO&amp;showAll=true&amp;multiline=true" />
            </idempotentConsumer>
          </route>
        </camelContext>
      
      </beans>
      

        Attachments

          Activity

            People

            • Assignee:
              lb Luca Burgazzoli
              Reporter:
              lb Luca Burgazzoli

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment