Is there a way to consume payloads from kafka without using @Incoming (Quarkus, smallrye, kafka)?

I'm creating a publish method using Emitter<> And I'm trying to create a unit test for this method. I don't want to use the InMemoryConnector (as described in the quarkus doc) I want to use the actual kafka connector configured in my application.yaml (mp: messaging: outgoing: : connector: smallrye-kafka)

So I'm trying to create a consumer in my test class to consume data from the kafka broker. That's why I don't want to use the @Incoming annotation. Is there on other way to consume data from the kafka ?

1 Answers

Yes, you can consume payloads from Kafka without using the @Incoming annotation in Quarkus with SmallRye Kafka connector. One way to achieve this is by directly creating a Kafka consumer in your test class to consume data from the Kafka broker. This approach allows you to interact with Kafka without relying on annotations.