I'm currently trying to get familiar with micronaut and Kafka. I've followed the documentation and created one KafkaClient in a microservice and one KafkaListener in a different microservice. The code looks like this:
Client. This is working as it's supposed to. I'm posting new messages in the vet-reviews topic:
@KafkaClient
public interface VetReviewClient {
@Topic("vet-reviews")
void send(VetReviewApi vetReviewApi);
}
Listener:
@KafkaListener(groupId = "pet-clinic", offsetReset = OffsetReset.EARLIEST)
@AllArgsConstructor
@Slf4j
public class VetReviewListener {
private VetService vetService;
@Topic("vet-reviews")
public void receive(@MessageBody VetReviewApi vetReviewApi) {
log.info("Received vet review: {}", vetReviewApi);
vetService.processVetReview(vetReviewApi);
}
}
Although posting the message in the topic, the listener does not pull the new message. I've followed the official micronaut-kafka integration documentation, but it does not work.
I know that this question was posted a while ago, but I don't see any answer and I'm unable to "revive" the problem by commenting because I don't have sufficient reputation.
Update on the problem. I've changed the Kafka docker image and that was it. Current working kafka-zookeper-kafdrop config: