Hi, I’m using the Kafka example from GitHub (https://github.com/marinkobabic/axon-kafka-example) and it’s working when connecting to a locally deployed Kafka cluster. As suggested by the docs, I’m trying to use a custom org.springframework.kafka.core.ProducerFactory by exposing a KafkaPublisher bean and overriding withProducerFactory(). My bean is created, but createProducer() of my custom ProducerFactory is never getting called. Any suggestions?
I was able to solve my problem by keeping the KafkaPublisher, but I needed to expose an EventBus bean (which I qualified in Sender.java) and wire up the publisher to it. I also needed to expose my own axon ProducerFactory that wrapped my own kafka ProducerFactory. My final configuration is as follows: