When I am using axon framework and reading documentation I see that I can change the queryBus, commandBus and eventBus, and there is three types : EmbeddedEventStore, SimpleCommandBus and AxonCommandServerBus So What is the difference between SimpleCommandBus, AxonCommandServerBus and EmbeddedEventStore??
As another user answered under this question of yours, Axon supports usages of three types of messages:
Knowing this, whenever you're looking for the difference between a CommandBus
or EventStore
implementation, that translates to the different message types.
Axon provides a CommandBus
to dispatch a command message from one end to another. In doing so, it keeps into mind the specific routing requirements of commands. The EventStore
in that perspective is in charge of storing event messages, and allowing a solution to retrieve events for Aggregates (event sourcing) and for Query Models (event streaming).
Now, to actual describe what they are:
Implementation of the EventStore
interface, using a so-called EventStorageEngine
to persist the events. The EventStorageEngine
has a JPA, JDBC, Mongo, and In-Memory implementation.
In short, this is the "configure your own event store" solution of Axon's EventStore
. If you prefer to use something with less configuration, I'd recommend using Axon Server.
The SimpleCommandBus
is a single JVM, single-threaded implementation of the CommandBus
interface. Due to this, it doesn't allow any parallelism in command dispatching and/or handling. Nor does it support the distribution of commands to other instances.
The AxonServerCommandBus
is a distributed, multi-threaded implementation of the CommandBus
interface, using Axon Server as the communication layer. Due to this, it allows parallelism within an application. It also knows how to send and retrieve commands to and from other application instances. Note that it expects Axon Server to be running and reachable by your Axon Framework application.
If you're curious about a more detailed differences between these three, I'd recommend to read the Reference Guide's their respective sections: