spring-attic / spring-integration-kafka

Apache License 2.0
325 stars 179 forks source link

Support custom Producer RecordMessageConverter #290

Closed powturns closed 4 years ago

powturns commented 4 years ago

It appears that it isn't possible to specify a custom RecordMessageConverter for a producer. While you are able to set the message converter on the KafkaProducerMessageHandler's template, internally the handler constructs a ProducerRecord and then calls KafkaTemplate.send(ProducerRecord<K, V> record) which bypasses the template's message converter.

See: https://github.com/spring-projects/spring-integration-kafka/blob/master/src/main/java/org/springframework/integration/kafka/outbound/KafkaProducerMessageHandler.java#L411

Original spring-cloud-stream issue: https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/790