Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active June 15, 2018 16:47
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 garystafford/176572b21d297eb13abb3dc0a61ddfeb to your computer and use it in GitHub Desktop.
Save garystafford/176572b21d297eb13abb3dc0a61ddfeb to your computer and use it in GitHub Desktop.
@Slf4j
public class Sender {
@Autowired
private KafkaTemplate<String, CustomerChangeEvent> kafkaTemplate;
public void send(String topic, CustomerChangeEvent payload) {
log.info("sending payload='{}' to topic='{}'", payload, topic);
kafkaTemplate.send(topic, payload);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment