Hi Allard,
To implement async event processing, I've configured an async cluster as shown in config snippet below:
@Bean
public EventBus eventBus(ClusterSelector clusterSelector,
EventBusTerminal eventBusTerminal) {
return new ClusteringEventBus(clusterSelector, eventBusTerminal);
}
@Bean
public ClusterSelector clusterSelector(
@Qualifier("asyncExecutor") Executor executor) {
// Create an event bus that dispatches events asynchronously, using multiple
// threads, while guaranteeing that events for each aggregate ID are
// dispatched to listeners in the order of their production.
Cluster cluster = new AsynchronousCluster(queueName + QUEUE_UNIQUIFIER,
executor, new SequentialPerAggregatePolicy());
return new DefaultClusterSelector(cluster);
}
I will also be implementing a Saga, so a few questions:
1) With the AysnchronousCluster, do I need to configure an AsyncAnnotatedSagaManager or an AnnotatedSagaManger?
2) Do I need to configure a transaction manager for the async event handling or async saga handling?
Regards,
Jeff