How to create a KafkaPublisher ?

The KafkaPublisherConfigurationBuilder. requires a SubscribableMessageSource, however the KafkaMessageSource implements only a StreamableMessageSource.

The reference guide shows this code

KafkaPublisherConfiguration configuration = KafkaPublisherConfiguration.<String, byte[]>builder()
.withProducerFactory(factory) // the factory for creating the actual client instances for sending events to kafka
.withTopic(“topic”) // the topic to send the events to. Defaults to ‘Axon.Events’

KafkaPublisher<String, byte[]> publisher = new KafkaPublisher<>(configuration); // create the publisher itself

publisher.start(); // to start publishing all events

However, not passing a message source gives me the following error using axon, and axon-kafka 3.3.3.

java.lang.IllegalArgumentException: The publisher must be configured with a MessageSource at org.axonframework.common.Assert.isTrue( ~[axon-core-3.3.3.jar:3.3.3] at org.axonframework.common.Assert.notNull( ~[axon-core-3.3.3.jar:3.3.3] at org.axonframework.kafka.eventhandling.producer.KafkaPublisherConfiguration$ ~[axon-kafka-3.3.3.jar:3.3.3]

I realized my confusion. I passed an eventstore as the SubscribableMessageSource.