Distributed Command Bus

Hi Allard, first thank you for the work you have done with Axon, That is impressive

Quick question for you,

When using distributed Command Bus i have define twos command Bus

public SimpleCommandBus localSegment() {
SimpleCommandBus commandBus = new SimpleCommandBus();
return commandBus;

@Bean @Lazy
DistributedCommandBus distributedCommandBus(){
// Setup the distributed command bus using the connector and the routing strategy
DistributedCommandBus commandBus = new DistributedCommandBus(jGroupsConnectorFactoryBean());
return commandBus;

What i would like to do is to use localSegment for local Commands in order to avoid overhead of serialization when i’m using the commands for the same JVM
But when i use i after committing i get a weird exception :

10:45:02.980 [nioEventLoopGroup-3-5] DEBUG o.a.u.DefaultUnitOfWork - Persisting changes to [state.model.PanelContext], identifier: [1001]
10:45:03.174 [nioEventLoopGroup-3-5] DEBUG o.a.u.NestableUnitOfWork - An error occurred while committing this UnitOfWork. Performing rollback…
com.thoughtworks.xstream.converters.ConversionException: Could not call java.util.PriorityQueue.writeObject() : Could not call java.util.concurrent.CopyOnWriteArrayList.writeObject() : Cannot marshal the XStream instance in action


The command handler get the command correctly but it is only when commiting that i got that exception ?

Do you have any idea of why i got this and at this time ? i though i would have to serialize that command anyway since i didn’t call distributed command ?


Do you copy any infrastructure components or entities (incl aggregate root) into your commands or events?



Oh i just forgot that the event store is storing data and is using serialization.