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’
.build();

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(Assert.java:54) ~[axon-core-3.3.3.jar:3.3.3] at org.axonframework.common.Assert.notNull(Assert.java:78) ~[axon-core-3.3.3.jar:3.3.3] at org.axonframework.kafka.eventhandling.producer.KafkaPublisherConfiguration$Builder.build(KafkaPublisherConfiguration.java:165) ~[axon-kafka-3.3.3.jar:3.3.3]

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