Custom Cluster with Spring Constructor Injection


I was following the following example that creates a custom cluster implementation:

<axon:cluster id="custoCluster">
    <bean class="com.mycompany.MyPersonalClusterImplementation"/>
        <axon:package prefix="com.mycompany.mypackage"/>

However, it appears to fail if MyPersonalClusterImplementation has a dependency on any beans that use constructor injection. It seems all beans need to have no-arg constructors for this to work. Is expected, or am I doing something wrong?

Effectively, all I’m trying to achieve is having Saga event handlers called last by putting the event listeners in a different cluster and setting the order appropriately. Perhaps if I can’t use the axon:cluster namespace there’s another way, but this seemed the cleanest…



What’s the failure you get? It should be possible to have (constructor-arg) dependencies from your clusters.