File polling by Camel doesn't work as expected in fabric mode
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&scheduler.cron=0/1+*+*+*+*+?&readLock=idempotent&idempotent=true&idempotentRepository=#messageIdRepository&scheduler.triggerId=startPollingInbound&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 of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
