Hi,
I wanted to add cached repository support. From my attempts it looks like when I want to keep PessimisticLockFactory it is only possible when SimpleCommandBus is used.
With SimpleCommandBus everything works nicely, but here’s what’s happening when I switch to DisruptorCommandBus.
Axon: 4.2
Bean definitions:
@Bean
public CommandBus customCommandBus(TransactionManager transactionManager, AxonConfiguration axonConfiguration) {
DisruptorCommandBus commandBus =
DisruptorCommandBus.builder()
.transactionManager(transactionManager)
.messageMonitor(axonConfiguration.messageMonitor(DisruptorCommandBus.class, "commandBus"))
.build();
commandBus.registerHandlerInterceptor(new CorrelationDataInterceptor<>(axonConfiguration.correlationDataProviders()));
commandBus.registerHandlerInterceptor(new LoggingInterceptor());
commandBus.registerDispatchInterceptor(new LoggingInterceptor());
return commandBus;
}