Accessing RecordMetadata in spring-cloud-stream-kafka binder: how to specify recordMetadataChannel

Viewed 196

I am writing a Kafka Producer and Consumer using spring cloud stream Kafka binder. I want access to the following information in both the producer and consumer

a) Topic
b) Partition
b) Offset

I did check the documentation, and am not really able to find where to get this is done. All I see in the documentation is to specify a recordMetadataChannel as part of the producer/ consumer configuration. Would someone point me to any samples of how exactly this is done?

1 Answers

The RecordMetadata in the message headers sent to that channel contains that information.

See this answer.

Related