Skip to content

Instantly share code, notes, and snippets.

@pramodpk89
Created May 1, 2020 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pramodpk89/a04beb655387c26e8cc3389a3ef50758 to your computer and use it in GitHub Desktop.
Save pramodpk89/a04beb655387c26e8cc3389a3ef50758 to your computer and use it in GitHub Desktop.
package com.ppk.kafkareader.service;
import lombok.SneakyThrows;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;
@Service
public class kafkaService {
@KafkaListener(topics = "first_topic")
@SneakyThrows
public void readPayload(String payload) {
System.out.println("Message read from kafka "+payload);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment