Axon Kafka maven dependency

Hi,

I’m using axon version 4.0.3, and thought I could combine that with the maven module axon-kafka 4.0-M2 (https://mvnrepository.com/artifact/org.axonframework/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 (https://github.com/AxonFramework/extension-kafka), 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,
David

Update:

Discovered an interesting document on the Axon repo: https://github.com/AxonFramework/AxonFramework/blob/144e2685aa2433c4bb448a1dfbbcafc5ee0f8070/axon-4-api-changes.md

So, now found the ‘correct’ kafka extension : https://mvnrepository.com/artifact/org.axonframework.extensions.kafka/axon-kafka/4.0-RC2

And according to the document:

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

So… giving this a try.

Kind regards,
David

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.

Cheers,
Steven

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

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