File polling by Camel doesn't work as expected in fabric mode

Solution Verified - Updated -

Issue

The same file being processed by more than 1 consumer, despite an JdbcMessageIdRepository has been configured to prevent that.

Example of configuration:

<route>
<from uri="file:///mnt/tmp/in/?scheduler=quartz2&amp;scheduler.cron=0/1+*+*+*+*+?&amp;readLock=idempotent&amp;idempotent=true&amp;idempotentRepository=#messageIdRepository&amp;scheduler.triggerId=startPollingInbound&amp;scheduler.triggerGroup=#{triggerGroup:UUID}"/>
...
<bean id="idempotentRepositoryDatasource" class="com.mysql.cj.jdbc.MysqlDataSource">
        <property name="databaseName" value="default" />
        <property name="url" value="jdbc:mysql://localhost:3306" />
        <property name="user" value="root" />
        <property name="password" value="fuse" />
    </bean>

<bean id="messageIdRepository" class="org.apache.camel.processor.idempotent.jdbc.JdbcMessageIdRepository">
        <constructor-arg ref="idempotentRepositoryDatasource" />
        <constructor-arg value="fileProcessor" />
        <property name="tableExistsString" value="SELECT 1 FROM DEFAULT.CUSTOMIZED_MESSAGE_REPOSITORY WHERE 1 = 0" />
        <property name="createString" value="CREATE TABLE DEFAULT.CUSTOMIZED_MESSAGE_REPOSITORY (processorName VARCHAR(255), messageId VARCHAR(100), createdAt TIMESTAMP)" />
        <property name="queryString" value="SELECT COUNT(*) FROM DEFAULT.CUSTOMIZED_MESSAGE_REPOSITORY WHERE processorName = ? AND messageId = ?" />
        <property name="insertString" value="INSERT INTO DEFAULT.CUSTOMIZED_MESSAGE_REPOSITORY (processorName, messageId, createdAt) VALUES (?, ?, ?)" />
        <property name="deleteString" value="DELETE FROM DEFAULT.CUSTOMIZED_MESSAGE_REPOSITORY WHERE processorName = ? AND messageId = ?" />
    </bean>
...

Environment

  • JBoss Fuse 6.3.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content