Apache Kafka record headers
- Last Updated: January 17, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
An Apache® Kafka® record may have headers associated with it. Headers allow you to provide metadata about the Kafka record, without having to add extra information to the name-value pair of the record itself. This topic contains example code for producing and consuming records with headers.
Producer-side
This example demonstrates how to produce records with multiple headers. The
AddHeader() method is called on the RecordBuilder object to add a header key-value pair.
Multiple headers are allowed and can be created by calling AddHeader() repeatedly.
|
Consumer-side
This example demonstrates how to consume a stream of records, where the records
have headers. An iterator is used to iterate over the headers, since there may be
multiple headers per record. For more information on iterators, see Progress.Collections.IIterator<T> interface in
the ABL Reference.
|