Hi,
We have configured our axonframework to use clustering event bus. We have two async clusters and one synchronous default cluster. The async clusters are configured with a FullConcurrencyPolicy and a ThreadPoolExecutorFactoryBean. The synchronous cluster is working fine, however the async cluster is processing one thing at a time and not processing asynchronously. We have tried different configurations and things got worse, in that we saw the async cluster process the first event and stops processing things after words.
Here is our configuration. Please let me know what we are doing wrong.
<!-- Axon Clusters -->
<!-- Create servicing async cluster -->
<axon:cluster id="asyncServicing">
<!-- the inner bean defines the actual cluster implementation to use. Here, it is an asynchronous cluster -->
<bean class="org.axonframework.eventhandling.async.AsynchronousCluster">
<constructor-arg value="asyncServicing"/>
<constructor-arg ref="asyncExecutor"/>
<constructor-arg>
<bean class="org.axonframework.eventhandling.async.FullConcurrencyPolicy"/>
</constructor-arg>
</bean>
<!-- Define servicing package we want to be handled by this cluster -->
<axon:selectors>
<axon:package prefix="com.xyz.servicing"/>
</axon:selectors>
</axon:cluster>
<!-- Create event store async cluster -->
<axon:cluster id="asyncEventStore">
<bean class="org.axonframework.eventhandling.async.AsynchronousCluster">
<constructor-arg value="asyncEventStore"/>
<constructor-arg ref="asyncExecutor"/>
<constructor-arg>
<bean class="org.axonframework.eventhandling.async.FullConcurrencyPolicy"/>
</constructor-arg>
</bean>
<!-- Define event store package we want to be handled by this cluster -->
<axon:selectors>
<axon:package prefix="com.xyz.eventstore"/>
</axon:selectors>
</axon:cluster>
<!-- We also create a simple cluster, and we define it as default, meaning it will be selected when no other
selectors (or clusters) match -->
<axon:cluster id="simple" default="true"/>
<!-- We need a thread pool to execute tasks -->
<bean id="asyncExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean">
<property name="corePoolSize" value="1"/>
<property name="waitForTasksToCompleteOnShutdown" value="true"/>
</bean>
Thanks,
MZ