A message’s journey through Axon Framework

In your application, you probably have created a couple of components:

  • client code that issues commands
  • a command handling component
  • an event handling component

But how does Axon Framework call these components precisely? The reference guide explains all available infrastructure components but does not have an overview of how and when each component is called.

Below you find a presentation that addresses this question of "How do they do it"; it shows the flow of starting up an Axon application and the steps and framework components involved in handling a command message and any resulting event messages.

The code that you see is from the cookbook recipe Simple application using Axon Framework and Spring Boot and revolves around a simple banking application that allows you to create accounts and deposit to or withdraw money from that account. In the walkthrough, I'll follow a command to withdraw some money from an account aggregate created earlier.

I'm using the Axon Spring Boot Starter, so this walkthrough uses a SimpleCommandBus, event-sourced Aggregates, and Subscribing Event Processors. In the future, I may expand on this by creating some more walkthroughs, but then for asynchronous command or event processing.

If you'd like to learn more about the inner workings of the Axon Framework, we host regular training.

An screenshot of one of the slides from the referred slideshow, in which is shown a diagram with the different components of an Axon Application (Client, Command Gateway, Command Bus, Command Handling Component, Event Bus & Event Store, Event Storage, View MOdels and Event Handling COmponent) and a text box explaining that "On application startup, Axon's SpringBoot AutoConfigurer creates the necessary infrastructure components (Command Gateway, Command Bus and Event Store, which also acts as the EventBus). Spring Boot also initializes the datastores for the event store and query models".

Check out our embedded slideshow to find out How do they do it?

Steven van Beelen
Lead Developer - Axon Framework. Steven has a keen interest in Axon Framework and how it approaches software architecture. He helps small and large clients build Axon applications, provides training, develops the framework and is active in the Axon community. Broader interests include domain driven design, messaging patterns and event sourcing.
Steven van Beelen