Asynchronous distributed command bus

Hi all,

I have a problem with my application [1]. I would like to make the distributed command asynchronous. I set up the local segments of the command bus like this: (other parts of the distributed command bus according to the documentation)

@Bean(destroyMethod = "shutdown")
public CommandBus localSegment(TransactionManager transactionManager) {
   AsynchronousCommandBus asynchronousCommandBus = new AsynchronousCommandBus();
   asynchronousCommandBus.registerDispatchInterceptor(new BeanValidationInterceptor<>());
   asynchronousCommandBus.registerHandlerInterceptor(new TransactionManagingInterceptor<>(transactionManager));

   return asynchronousCommandBus;

The invocation inside of the local segment is asynchronous. The invocation of remote service is not. I am using Spring cloud with AMQP for events. I wonder if I am missing something.

I can see that SpringHttpCommandBusConnector uses the REST operations - is there a way to make the REST call async?



Hi Martin,

we’ll have a look into this. It is definitely possible to use an AsyncCommandBus as local segment (just @Qualifier(“localSegment”) a CommandBus bean in your context). However, that will still do a blocking http call. We’ll have a look at how we can improve on this.