tracking event processors need to be activated, indeed. It’s a one-liner to activate that for all processors.
If you have JPA on the classpath, you will automatically get a Jpa based Event Store implementation. Axon falls back to SimpleEventBus when there is no JPA (or JDBC) available, and there is no EventStorageEngine defined.
Distributed implementations are also available in Axon itself, either using Spring Cloud, or JGroups for the CommandBus, and then Kafka or Spring AMQP for Events. A DistributedQueryBus is not yet available.
In my simple case no eventstore is used. All I tried is to send an even using the producer application. This worked perfectly after setting all the required configuration.
The consumer did not work that easy. All the configuration ware set, but it did still not work. Have no jdbc nor jpa on the class path. The idea is only to use the eventbus without eventstore. Because of the given environment the Axon Framework used the SimpleEventBus. SimpleEventBus is in this case the source of the events for the processors. The autoconfigured KafkaEventSource was not used at all.
What is the correct way to tell Axon to use KafkaEventSource as source of the events for the eventbus? Can this be done by configuration or is a custom eventbus the way to go?
You can check the sample application in the link in the previous post.
You can configure your Processing Groups to use a specific ‘source’ for their events.
By default, Axon will use the EventStore/EventBus for this.
If you require those events to come from a AMQP queue or Kafka topic, you will have to tell that specific Processing Group to use that as the source of it’s events.
You can adjust this by either using the Configuration API provided by Axon or in a Spring environment by setting your properties.
The latter could make you end up with a line like this in your properties fiel:
The ‘name-of-processing-group’ can be set for your Event Handling Components by either (1) using the Configuration API again and specifying it yourself or by (2) setting the ‘@ProcessingGroup({name-of-processing-group})’ on your Event Handling classes. I’d argue the latter is the easiest approach, as you’re pointing out you’re using Spring Boot.
The ‘bean-name-of-source’ in this scenario is the name of your KafkaMessageSource.
Lastly I’d like to note that AxonDB and AxonHub aren’t requirements to run your applications distributed.
They just make your life a hell of a lot easier.
If you want any information on how to use them, feel free to contact us at AxonIQ.
Apart from that, I hope this helps you out Marinko!
The documentation should be adjusted so that this is clear to everybody. Have made the changes before your post and all works out of the box. Many thanks anyway.
I’m missing an architecture overview in generally of the Axon Framework. Why does the eventbus have a method OpenStream. Bus is not a repository. Trackerprocessor what? Processinggroup? After digging the code I have now a better understanding but this does not help others. A picture with all the components would be helpful at all.