Skip to content

Axon

Axon Framework is a framework for building evolutionary, message-driven microservice systems based on the principles of Domain-Driven Design (DDD), Command-Query Responsibility Separation (CQRS), and Event Sourcing.

The whole 'Axon Framework'-project consists of numerous repositories you can use in combination with one another to build a flexible and sustainable application landscape. Although the main repository, Axon Framework, is undoubtedly the core, you can optimize and enhance it by utilizing the other available tools.

Contents

For more information on anything Axon, please visit our websites, https://developer.axoniq.io/ and https://axoniq.io. The former provides dedicated developer information, like explaining concepts, the available tooling, and blogs. The latter contains information about AxonIQ, the company maintaining the 'Axon Framework'-project, providing information like the products, use cases, subscriptions, and training.

Axon Framework

Axon Framework provides you with the necessary building blocks to follow these principles. The messaging support for commands, events, and queries is at the core of these building blocks. The messaging basics enable an evolutionary approach towards microservices through the location transparency they provide.

The building blocks include aggregate design handles, aggregate repositories, command buses, saga design handles, event stores, query buses, and more. The framework provides sensible defaults for all of these components out of the box.

Axon Framework assists in distributing applications to support scalability or fault tolerance. The most accessible and quick road forward would be to use Axon Server to seamlessly adjust message buses to distributed implementations. It does so by being a dedicated message router and an efficient event store implementation for scalable event sourcing.

Next to Axon Server, several of Axon's extensions can help in this space too. However, they will require a little more handy work from the developer to set up, as knowledge of the tools supported by the extensions is required.

In conclusion, all this combined helps to create a well-structured application without worrying about the infrastructure. Hence, your focus can shift from non-functional requirements to your business functionality.

If you want to learn more about Axon Framework, you can visit the product page here and the developer-focused page here.

Getting started

Numerous resources can help you on your journey in using Axon Framework. A good starting point is AxonIQ Developer Portal, which provides links to resources like blogs, videos, and descriptions.

There are, however, a lot more resources you can benefit from.

For example, training:

  • We have our very own Academy! The introductory courses are free, followed by more in-depth (paid) courses.
  • Next to the Academy, there are dedicated training sessions provided by AxonIQ. Check out the Training courses page for more information about these.

Or, the documentation and forum:

  • The documentation explains all of the components maintained within Axon Framework's products.
  • If the guide doesn't help, our forum provides a place to ask your questions during development.
  • Posting questions on StackOverflow next to Axon's forum is also possible. When doing so, add the axon tag! This tag will nudge AxonIQ developers, which will cover those on a best-effort basis.

And several sample projects you can check out:

When ready to start, you can quickly and easily begin your Axon Framework-based application with the AxonIQ Initializr at https://start.axoniq.io/. Note that this solution is only feasible if you want to stick to the Spring ecosphere!

Receiving help

Do you need help with using any of our libraries or products? Know that we want to help you out the best we can! There are a couple of things to consider when you're traversing anything Axon:

  • Checking the documentation page should be your first stop when anything is unclear.
  • When the documentation does not cover your predicament, we would greatly appreciate it if you could file an issue for it. Drafting issues helps us to improve the documentation for all users based on your valuable input.
  • Our forum provides a space to communicate with the Axon community to help you out. AxonIQ developers will help you out on a best-effort basis. And if you know how to help someone else, we greatly appreciate your contributions!
  • We also monitor Stack Overflow for any question tagged with axon. Similarly to the forum, AxonIQ developers help out on a best-effort basis.
  • We built Inspector Axon purposefully to help you inspect your Axon Framework application in detail. Attaching it to your project is straightforward, providing you with a dashboard with specialized metrics and message flow diagrams, to name a few.
  • If you are developing in IntelliJ IDEA, know that we have constructed a plugin to streamline the development of Axon-based applications.

Axon Server

Through Axon Framework, users can quickly build flexible applications by leveraging the building blocks for DDD, CQRS, and Event Sourcing.

The message-driven nature of the framework becomes particularly useful when scaling the application or breaking it apart into distinct microservice. Furthermore, by Event Sourcing, you are future-proof to any shift and change of the models.

Both benefits come with their own set of requirements. Firstly, we are inclined to use a distributed version of the CommandBus, EventStore, and QueryBus to break apart an application, considering their distinct routing requirements. Secondly, as Event Sourcing requires us to store events forever, the event store will grow indefinitely.

Axon Server greatly simplifies these requirements by implementing these four requirements. It is a dedicated message routing solution knowledgeable about the need to consistently route commands, stream events as fast as possible, and support the differing querying needs of each service. But most of all, Axon Server is an event store, a database specifically designed for storing events for event sourcing purpose. It offers superior scalability and throughput characteristics without requiring complex tuning of, for example, an RDBMS.

By using Axon Server in combination with Axon Framework, you will thus resolve the need to set up a distributed version of each bus and drop the requirement to optimize your event store by hand.

Be sure to visit the dedicated Axon Server page to learn more about all its capabilities and usages. If desired, you can download it here for free to give it a try. And if you are curious about the additional features provided next to those described above, you can get a trial license by filling in this form.

If you want to learn more about Axon Server, you can visit the product page here and the developer-focused page here.

Extensions

Where Axon Framework contains the core functionality for event-driven application construction, the extensions add valuable integrations with other tools and languages to enhance Axon's capabilities. The extensions are intentionally split off from the main framework to not over encumber the user with unused functionality and obstruct the release cycles of the separate repositories.

The functionality of the extensions ranges from event streaming integrations with AMQP and Kafka, database tooling like Mongo, and language-specific integrations as with the Kotlin extension. For more details about each extension, we refer to the subsections below.

Contents

AMQP

The AMQP Extension repository provides support for the Advanced Message Queuing Protocol (AMQP).

Users can add this extension to, for example, include a RabbitMQ integration with their Axon Framework application. Setting up this integration allows you to publish Axon events to an AMQP exchange. Events can also be read from exchanges and handled by event processors, providing means of integrating with other services.

In doing so, you would enable (micro)service communication through event streaming. Or, you can attach a (third-party) application with your Axon Framework application, communicating through AMQP.

You should regard this extension as a partial replacement of Axon Server as, compared to Axon Server, it only covers event streaming.

Please read the AMQP section of the documentation for more information about this extension.

JGroups

The JGroups Extension repository enables integration with JGroups.

You can use this extension to enable command routing in a distributed environment. As command routing differs from, for example, load balancing REST operation, it is highly recommended to use a distributed command routing solution whenever you have several applications and/or application instances that need to communicate with one another.

The extension achieves this by implementing the CommandRouter and CommandBusConnector, consolidated in the JGroupsConnector. This connector provides the service discovery and message routing required to pass CommandMessages from one application (instance) to another.

You should regard this extension as a partial replacement of Axon Server as, compared to Axon Server, it only covers command routing.

Please read the JGroups section of the documentation for more information about this extension.

JobRunr Pro

The JobRunr Pro Extension repository provides support for the "pro" edition of JobRunr.

Users can benefit from this extension whenever they have:

  1. Acquired JobRunr Pro, and
  2. want to use Axon's deadline management functionality.

We constructed this extension as some feature on the DeadlineManager API cannot be supported with the free edition of JobRunr.

Please read the Jobrunr Pro section of the documentation for more information about this extension.

Kafka

The Kafka Extension repository enables integration with Kafka.

Setting up a Kafka integration with your Axon Framework applications allows you to:

  1. Publish Axon Event Messages onto one or more Kafka topics, and
  2. to read Kafka Consumer Records converted to Axon Event Messages into your @EventHandler annotated methods.

In doing so, you would enable (micro)service communication through event streaming. Or, you can attach a (third-party) application with your Axon Framework application, communicating through Kafka.

Note that the Axon Framework team does not intend to support Event Sourcing through the Kafka Extension. Although there are Kafka-focused articles explaining how to achieve this, we find this a suboptimal solution leading to predicaments in the future. We thus suggest you choose Axon Server, an RDBMS solution or the MongoDB Extension to store your events and subsequently support event sourcing.

You should regard this extension as a partial replacement of Axon Server as, compared to Axon Server, it only covers event streaming.

Please read the Kafka section of the documentation for more information about this extension.

Kotlin

The Kotlin Extension repository eases Axon Framework development for Kotlin-based applications.

You can use this extension to relieve some of the "awkwardness" of the Axon Framework API when using Kotlin to build your application(s). It does so by providing reified methods of several of Axon's infrastructure components, like the command and query gateway, upcasters, and the test fixtures.

Please read the Kotlin section of the documentation for more information about this extension.

MongoDB

The MongoDB Extension repository enables MongoDB as a storage solution throughout the framework.

Users can set this extension whenever they want to use MongoDB to store:

Especially when you store Query Models or inside a MongoDB collection, we recommend you keep the tracking tokens of the streaming processor inside MongoDB as well. By doing so, you ascertain that the framework uses a single transaction to update the model and token.

The same logic applies to Sagas that are backed by streaming processors and stored in MongoDB; storing the tokens next to the saga instances makes the application more robust.

Note that although you can use this extension to adjust MongoDB into an event store, we do not necessarily recommend this. During the lifecycle of this extension, we have noticed predicaments with how MongoDB behaves, causing the event store to act suboptimal from a performance perspective. We thus recommend either Axon Server (the highest level of performance for event storage) or an RDBMS of choice instead.

You should regard this extension as a partial replacement of Axon Server as, compared to Axon Server, it only covers event storage.

Please read the MongoDB section of the documentation for more information about this extension.

Multitenancy

The Multitenancy Extension repository provides integrated support for multitenancy to your Axon Framework application.

By adding this extension to your Axon Framework application(s), you receive multi-tenant versions of all the infrastructure components the framework provides. In doing so, you can run a single instance of an application but serve many of your tenants in one go. Interfaces like the CommandBus, EventProcessor, and SequencedDeadLetterQueue are implemented by this extension to delegate tenant-specific tasks to concrete implementations of these components.

If you combine Axon Framework and the Multitenancy Extension with Axon Server, the multitenancy experience of your app(s) is seamless. The extension achieves this by utilizing Axon Server's multi-context behavior to dynamically create new tenants (read: a context per tenant) whenever you register them. It is usable without Axon Server, but you will be inclined to implement factories for the infrastructure components yourself.

Please read the Multitenancy README.md for more information about this extension.

Reactor

The Reactor Extension repository provides Axon Framework infrastructure components using the Project Reactor API.

You can add this extension to your Axon Framework project to use results like Mono and Flux on framework components. It provides Reactor versions of Axon's gateways, allowing you to leverage the reactive API on the edge of your Axon Framework application.

Please read the Reactor section of the documentation for more information about this extension.

Spring Cloud

The Spring Cloud Extension repository enables integration with Spring Cloud.

You can use this extension to enable command routing in a distributed environment. As command routing differs from, for example, load balancing REST operation, it is highly recommended to use a distributed command routing solution whenever you have several applications and/or application instances that need to communicate with one another.

The extension achieves this by implementing the CommandRouter and CommandBusConnector, consolidated in the SpringCloudeCommandRouter and SpringHttpCommandBusConnector, respectively. This connector provides the service discovery and message routing required to pass CommandMessages from one application (instance) to another.

Since the implementation uses the Spring Cloud discovery interfaces to perform the service discovery, you are able to choose a multitude of implementations to enable distributed command routing. You can, for example, use implementation like Netflix, Consul, Zookeeper, Kubernetes, and many more.

You should regard this extension as a partial replacement of Axon Server as, compared to Axon Server, it only covers command routing.

Please read the Spring Cloud section of the documentation for more information about this extension.

Spring AOT

The Spring AOT Extension repository enables native compilation of Spring Boot based Axon projects.

This extension allows you to compile to a native image whenever you combine Axon Framework with Spring.

Tracing

The Tracing Extension repository enables integration with Open Tracing.

When using this extension, you will replace the Command- and QueryGateway with implementations that attach span information to your Messages. Furthermore, when handling a Message, a dedicated MessageHandlerInterceptor ensures the span is populated on the overall trace.

Although this is valuable, it is essential to mention that the Open Tracing implementation has been archived in favor of Open Telemetry. Furthermore, as of Axon Framework version 4.6.0, the framework provides native support for Open Telemetry.

We thus recommend that you use the integrated tracing support whenever you are on Axon Framework version 4.6 or above.

Nonetheless, we still maintain and update the Tracing Extension for the time being. As such, you can be certain the extension still works as intended.

Please read the Tracing section of the documentation for more information about this extension.

Bill of Materials

The Bill of Materials repository of Axon Framework is a dedicated dependency providing compatible versions of the framework and extensions. Hence, by adding axon-bom to your dependency management system, you ensure the compatibility of Axon's dependencies. As such, we recommend you use this dependency whenever you combine Axon Framework with any of the extensions.

Inspector Axon

The Axon Framework team designed Inspector Axon to further enable Axon Framework applications with valuable data and tooling.

Inspector Axon provides you with numerous benefits:

  • Event Processor management tooling, like start, stop, split, and merge
  • Automated monitoring of all your message handlers
  • Insights into the flow of your messages with valuable diagrams
  • The information required to deep-dive into the performance of your Axon Framework application

By doing all this, we aim to teach the inner workings of Axon Framework to any user, enabling you the get the most out of the framework.

The how it works page helps you understand how Inspector Axon provides all this information. We refer you to this page if you (and your team) are curious to understand how we secure all this behavior.

IntelliJ IDEA Plugin

The Axon Framework IntelliJ Plugin is a plugin you can add when using IntelliJ IDEA. Including this plugin eases your developer experience of Axon Framework 4.x-based applications.

Some of the features this plugin adds to IntelliJ are:

  • Line markers to visualize messages
  • Axon Framework-specific code structure inspections
  • Easy access to the documentation

Please read the README of the IdeaPlugin project to learn more about this plugin.

AxonIQ Initializr

The AxonIQ Initializr is a tool providing a kickstart into your Axon Framework- and Spring Boot-based application.

When browsing to https://start.axoniq.io/ you are prompted with the ability to specify the basis of your application-to-be. As may become apparent, the AxonIQ Initializr is a variant of the Spring Initializr with Axon Framework-specifics attached.

Due to this, you can also utilize the Initializr through IntelliJ IDEA when constructing a new project (just as with the Spring Initializr).

Although the Initializr is not strictly a part of the Axon Framework project, we mention it regardless as it focuses on kickstarting your Axon Framework application(s).

Data Protection Module

As you may know, Event Sourcing dictates that you never remove or update events. With the introduction of Data Protection Laws like GDPR, developers using Event Sourcing in their applications are thus faced with a predicament. A predicament you are required to resolve by law.

As one of Axon Framework's pillars is to enable Event Sourcing, we are inclined to provide a solution. As such, AxonIQ constructed the Data Protection Module in response to these new requirements.

The Data Protection Module is a Java library providing the tooling to mark specific data inside events as "personally identifiable information" (PII for short). Then when you store the event or send it over a network, you can encrypt the PII within the event to protect it. From there, you can choose a preferred key management system, with options like relation databases, hardware security modules, and HashiCorp Vault.

In combination with Axon Framework, you can implement the described behavior seamlessly by using dedicated annotations and a custom Serializer as provided by the Data Protection Module. If you require more information about the Data Protection Module, be sure to reach out.

Pinned

  1. AxonFramework AxonFramework Public

    Framework for Evolutionary Message-Driven Microservices on the JVM

    Java 3.2k 777

Repositories

Showing 10 of 27 repositories

Top languages

Loading…

Most used topics

Loading…