Skip to content

Instantly share code, notes, and snippets.

@maheshwarLigade
Last active July 26, 2021 04:46
Show Gist options
  • Save maheshwarLigade/643d1574a5bfb4c1a97ba1681d9f3143 to your computer and use it in GitHub Desktop.
Save maheshwarLigade/643d1574a5bfb4c1a97ba1681d9f3143 to your computer and use it in GitHub Desktop.
package com.techwasti.kafkaex;
import io.micronaut.configuration.kafka.annotation.KafkaKey;
import io.micronaut.configuration.kafka.annotation.KafkaListener;
import io.micronaut.configuration.kafka.annotation.Topic;
import io.micronaut.configuration.kafka.annotation.OffsetReset;
@KafkaListener(offsetReset = OffsetReset.EARLIEST)
public class GreetMessageConsumer {
@Topic("greet")
public void receive(@KafkaKey String day, String message) {
System.out.println("Got Message for the - " + day + " and Message is " + message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment