Created
October 2, 2019 01:28
-
-
Save sohangp/53c8b23a641b1ebbcd619dceba46f3a8 to your computer and use it in GitHub Desktop.
Publish Kafka Message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void sink(Map<String, Object> polledMessage) { | |
log.info("Sending to message broker: {}", polledMessage); | |
String topic = ((String) polledMessage.get("event_type")).toLowerCase(); | |
String payload = (String) polledMessage.get("payload"); | |
kafkaTemplate.send(topic, payload); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment