public class RecorderApplication
{
@Bean(destroyMethod = "close")
- KafkaProducer<String, Recording> producer(RecorderApplicationProperties properties)
+ KafkaProducer<User, Recording> producer(RecorderApplicationProperties properties)
{
Assert.hasText(properties.getBootstrapServer(), "juplo.wordcount.recorder.bootstrap-server must be set");
public class RecorderController
{
private final String topic;
- private final KafkaProducer<String, Recording> producer;
+ private final KafkaProducer<User, Recording> producer;
public RecorderController(
RecorderApplicationProperties properties,
- KafkaProducer<String,Recording> producer)
+ KafkaProducer<User, Recording> producer)
{
this.topic = properties.getTopic();
this.producer = producer;
{
DeferredResult<ResponseEntity<RecordingResult>> result = new DeferredResult<>();
- ProducerRecord<String, Recording> record = new ProducerRecord<>(
+ ProducerRecord<User, Recording> record = new ProducerRecord<>(
topic,
- username,
+ User.of(username),
Recording.of(username, sentence));
producer.send(record, (metadata, exception) ->