Event Handlers without an aggregate

I am new to the axon framework. I am using a distributed event bus via kafka (axon extensions framework). I have two separate applications. One application will be publishing events whose handlers are present in the second application. Now, the event messages are being published to the kafka topic but it is not handled by the event handles present in the second application.

The second application does not have an aggregate class. It only has a class where all the event handlers are present. The event handler class is annotated with @Component and @Processing group(“test”). The processing group: “test” is configured to be tracking and its’ source is streamableKafkaSource which is configured with the proper kafka topic and the kafka consumer id. I also created a bean of the event handler class. What should I add more to get the event handlers working?

Unfortunately, I cannot share the code outside of my company’s network and thanks in advance for any kind of hep.


Can you share which version of Kafka module you are using, please? …and are these two applications Axon apps?
I hope that this first application is Axon app and that it is publishing events via Kafka extension as well. It is fine if you have only event handlers on the second app, you do not need aggregate there for this to work.


Yes, the two applications are axon apps. The first application is publishing events via the kafka extension. The kafka version is 2.3.1

It could be somewhere in your configuration. Hopefully, you are using the latest version of Axon Kafka module.

The docs are located here: https://docs.axoniq.io/reference-guide/extensions/kafka
The implementation of the extension can be found here . The shared repository also contains a sample project using the extension.

I hope this helps, but I’m not able to do much more if you can not share your configuration here :frowning:


Thanks for your replies. I encountered a similar problem. I have a command handler lying outside an aggregate. It publish an event using eventGateway.publish() and this event is the first event of the saga. Although the event is being published to kafka, the saga handler is not being called and the event is not being stored in the domain_event_entry table. The command handler class and the saga handlers lie in the same application. Do we need some additional configuration to get the saga handlers working?

Hi Shreya,

Like Ivan was saying, without any insights in how you are using/configuring the components it’s pretty hard for us to deduce what might be wrong.

To rehash, there is a sample project in the shared repository.
This sample can be configured to use subscribing or tracking event processors for both publication and consumption of events on/to a Kafka topic.
How to run this is described in the README.md which you should see when opening the shared sample project link.

Know that this sample project thus exactly does what you require: publishing events on a Kafka topic through Axon and reading events from a Kafka topic through Axon.

Note that we are obviously not interested in your client’s code.
But a sample configuration omitting any client specific code would be clear enough for readers too to deduce what might be awry.