Hi,

I am trying to transfer messages from an ActiveMQ Classic queue to IBM MQ, and 
I want to make sure messages are not processed twice.  I would like to use the 
Cassandra Idempotent Repository:

https://camel.apache.org/components/4.10.x/cql-component.html#_idempotent_repository

Are there any good examples on how to accomplish this?  So far, I have this, 
but I am missing how to connect to the Cassandra database.  I am guessing this 
would be for an in-memory only Cassandra database?

…
<bean id="repo” 
class="org.apache.camel.support.processor.idempotent.MemoryIdempotentRepository"/>

<camelContext
id="camel" xmlns="http://camel.apache.org/schema/spring"; streamCache="true">
     <route id="MY.ROUTE”>
          <from uri="jms: 
queue://SOURCE.QUEUE?cacheLevelName=CACHE_CONSUMER&amp; 
concurrentConsumers=2&amp;maxConcurrentConsumers=4&amp;maxMessagesPerTask=100&amp;
 transacted=falsesamp; 
lazyCreateTransactionManager=false&amp;acknowledgementModeName=CLIENT_ACKNOWLEDGE&amp;connectionFactory=#activemq"/>

<idempotentConsumer messageIdRepositoryRef=“repo”>
     <simple>header.TransactionID</simple>
          ‹onException>
              <exception>java.io. IOException</exception>
               
<exception>org.springframework.jms.IllegalStateException</exception>
              <exception>com.ibm.mg.MQException</exception>
              ‹handled>
                   ‹constant>true</constant>
              </handled>
              <to uri="jms: queue: //DEST.QUEUE” 
disableReplyIo=truesamp;deliveryPersistent=false&amp;acknowledgementModeName=CLIENT_ACKNOWLEDGE&amp;connectionFactory=#activemg
          </onException>
...

Regards,

William Crowell


This e-mail may contain information that is privileged or confidential. If you 
are not the intended recipient, please delete the e-mail and any attachments 
and notify us immediately.

Reply via email to