use of org.springframework.integration.kafka.outbound.KafkaProducerMessageHandler in project spring-integration-samples by spring-projects.
the class Application method handler.
@ServiceActivator(inputChannel = "toKafka")
@Bean
public MessageHandler handler(KafkaTemplate<String, String> kafkaTemplate) {
KafkaProducerMessageHandler<String, String> handler = new KafkaProducerMessageHandler<>(kafkaTemplate);
handler.setMessageKeyExpression(new LiteralExpression(this.properties.getMessageKey()));
return handler;
}
Aggregations