Skip to content

Instantly share code, notes, and snippets.

@pramodpk89

pramodpk89/kafkaService.java Secret

Created May 1, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.