1

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?

halfer
  • 19,824
  • 17
  • 99
  • 186
Ani
  • 11
  • 1
  • 2

1 Answers1

0

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

See this answer.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179