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?

Written by:

Steven van Beelen

Steven is a lead developer at AxonIQ with a keen interest in new and exciting technologies and methodologies.
Furthermore, he's a developer passionate about helping others make awesome software. 
This has led him to embrace the open-source mindset, become a trainer, a speaker, and provide guidance on various Q&A fora.

He focuses on concepts like DDD, CQRS, and Event Sourcing, as he sees those as great enablers for well-structured, modular applications. 
Most of his time is spent developing Axon Framework at AxonIQ to enhance the support of these concepts. 
When he's not writing code or helping others, he's likely busy with music, video games, or real-life construction work.