Skip to content

Instantly share code, notes, and snippets.

@itzg
Last active September 16, 2020 18:48
Show Gist options
  • Select an option

  • Save itzg/1900b6ba342393771ba42d7978ec3638 to your computer and use it in GitHub Desktop.

Select an option

Save itzg/1900b6ba342393771ba42d7978ec3638 to your computer and use it in GitHub Desktop.
import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class ConsumerService {
@KafkaListener(topics = "my-topic")
public void consumeMessage(String message) {
log.info("Got message : {}", message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment