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's Profile photo

Steven van Beelen

Steven van Beelen is a Lead developer at AxonIQ with a keen interest in new and exciting technologies and methodologies.

The last couple of years this interest has chiefly been fulfilled by the Axon Framework and how it approaches software architecture. This eventually led him to become a part of the AxonIQ team. There, he currently helps small and large clients build Axon applications, gives training in it, develops the framework and is overall active in the Axon community. Always keen to learn and improve himself in the software space, he reads up on more abstract concepts like domain driven design, messaging patterns and event sourcing. He also keeps himself up to date with more concrete topics like new frameworks and languages to improve his skill as a developer.