Axon Kafka maven dependency


I’m using axon version 4.0.3, and thought I could combine that with the maven module axon-kafka 4.0-M2 (

However, when running it gives an exception :

java.lang.NoSuchMethodError: org.axonframework.serialization.xml.XStreamSerializer: method ()V not found

The KafkaPublisherConfiguration tries to instantiate an XStreamSerializer using a default constructor. However, the XStreamSerializer in axon-messaging 4.0 does not have a default constructor!
Hasn’t had that for quite a while apparantly.

In the repository I noticed that the kafka module was extracted in a seperate repository (, which contains a tag for 4.0-RC2 …
however, this code base does not even have a KafkaPublisherConfiguration.

What maven configuration and spring configuration (non-boot) should I use to have Axon publish stored events to a kafka topic ?

Kind regards,


Discovered an interesting document on the Axon repo:

So, now found the ‘correct’ kafka extension :

And according to the document:

org.axonframework.kafka.eventhandling.producer.KafkaPublisherConfiguration Removed in favor KafkaPublisher.Builder

So… giving this a try.

Kind regards,

Hi David,

This ‘interesting document’ is what we’ve kept up to date in regards to breaking API changes.
It will be the basis for the migration guide 3 to 4, which we’ll add to the Reference Guide at some point.
For now though, using version 4.0-RC2 should be the right thing to do - happy you’ve found the solution yourself.

That’s my 2 cents.


Clear. Good to hear I was on the right track.

Running into the same issues. Glad that I found your post.