Stuart winchester in Java 2 minutes

Camel Jdbc Aggregation Repository

Just a post to note that if you are running multiple aggregators in your context, then you will need to ensure you specify different aggregation repositories.

<bean class="org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository" id="repo">
	<property name="repositoryName" value="repo"/>
	<property name="transactionManager" ref="txManager"/>
	<property name="dataSource" ref="dataSource"/>
</bean>

The repositoryName is used for the underlying table names. If two aggregations are using the same repository there is the possiblity that they willl interfere with each other. Therefore it is essential that if you need two aggreation repositories that you specify another JdbcAggregationRepository bean with a different repositoryName.

<bean class="org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository" id="repo">
	<property name="repositoryName" value="repo"/>
	<property name="transactionManager" ref="txManager"/>
	<property name="dataSource" ref="dataSource"/>
</bean>
<bean class="org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository" id="repo2">
	<property name="repositoryName" value="repo2"/>
	<property name="transactionManager" ref="txManager"/>
	<property name="dataSource" ref="dataSource"/>
</bean>

References