This Spring Boot demo project shows how to configure the Axon Framwork, so that Events are only handled by the instances which publish them.
See Stack Overflow discussion with Steven van Beelen for further details.
-
Axon Spring Boot Starter: Spring Boot Autoconfiguration for Axon.
-
JpaEventStorageEngine: A SQL Server based JpaEventStorageEngine as EventStore & TokenStore.
-
TrackingeEventProcessor: A TrackingEventProcessor for a single EventSource is configured (default of Axon Spring Boot Starter).
-
CorrelationDataProvider: A CorrelationDataProvider is used to add Metadata to every published Event.
-
MessageHandlerInterceptor: A MessageHandlerInterceptor is used filter Events which should be processed by the same application instance.
Use the sql-server-test-db run config if you're using IntelliJ IDEA or start the docker-compose.yml otherwise.
Use the new-app-instance run config if you're using IntelliJ IDEA or start the Application.kt otherwise.