Unable to read Axon-Kafka Messages in a Non-Axon Downstream Java application

Hi,
We have run in to blocker issue with one of the use cases for Axon-Kafka.
We have built a system that runs on Axon and follows all the life cycle.
When I execute AggregateLifeCycle.apply it publishes messages to a Kafka Topic.
we have down stream applications that is based up of basic spring-boot-kafka framework.
They are trying to deserialize the message and are unable to do so.

My question is can Axon not publish raw messages to Applications that are not using Axon framework ? If they do what needs to be done on the consumer side.

Please let me know if this is a limitation.

Thanks,
Sandeep

Hello Sandeep,

Can you share how you forward/publish events to Kafka topic please? Are you using Axon Kafka module/extension?
I’m not sure if Kafka extension can publish messages in Spring format at the moment to be honest. The message converter responsible for this is here.

Axon community played with Axon Spring Cloud Stream (and Integration) extension: https://github.com/idugalic/axon-extension-spring-cloud-stream.
It is not official extension yet, but I believe that integrates with Spring messaging formats better (see this message converter: https://github.com/idugalic/axon-extension-spring-cloud-stream/blob/master/axon-spring-cloud-stream/src/main/java/org/axonframework/extensions/stream/converter/DefaultSpringMessageEventMessageConverter.java).

You can use Source part (you want to publish events from your app only) https://github.com/idugalic/axon-extension-spring-cloud-stream#source. There is a demo app that should be inline with your case: https://github.com/idugalic/axon-extension-spring-cloud-stream/tree/master/axon-spring-cloud-stream-demo/axon-spring-cloud-stream-demo-source/axon-spring-cloud-stream-demo-kafka-source

PS. Extension is really small, feel free to use it (you can extract only Source part of it) and make it part of your source code if you like.

Best,
Ivan

Hi Sandeep,

Axon uses serializers to serialize objects when sending them over the wire. Some serializers are more implementation-specific than others. The Jackson Serializer, for example, will just serialize to json, which is very interoperable. So when you send events to a Kafka topic, there shouldn’t be anything withholding you from reading those messages without using Axon.

Cheers,