kafka/docs
Randall Hauch 4c48942f9d KAFKA-5142: Add Connect support for message headers (KIP-145)
**[KIP-145](https://cwiki.apache.org/confluence/display/KAFKA/KIP-145+-+Expose+Record+Headers+in+Kafka+Connect) has been accepted, and this PR implements KIP-145 except without the SMTs.**

Changed the Connect API and runtime to support message headers as described in [KIP-145](https://cwiki.apache.org/confluence/display/KAFKA/KIP-145+-+Expose+Record+Headers+in+Kafka+Connect).

The new `Header` interface defines an immutable representation of a Kafka header (key-value pair) with support for the Connect value types and schemas. This interface provides methods for easily converting between many of the built-in primitive, structured, and logical data types.

The new `Headers` interface defines an ordered collection of headers and is used to track all headers associated with a `ConnectRecord` (and thus `SourceRecord` and `SinkRecord`). This does allow multiple headers with the same key. The `Headers` contains methods for adding, removing, finding, and modifying headers. Convenience methods allow connectors and transforms to easily use and modify the headers for a record.

A new `HeaderConverter` interface is also defined to enable the Connect runtime framework to be able to serialize and deserialize headers between the in-memory representation and Kafka’s byte[] representation. A new `SimpleHeaderConverter` implementation has been added, and this serializes to strings and deserializes by inferring the schemas (`Struct` header values are serialized without the schemas, so they can only be deserialized as `Map` instances without a schema.) The `StringConverter`, `JsonConverter`, and `ByteArrayConverter` have all been extended to also be `HeaderConverter` implementations. Each connector can be configured with a different header converter, although by default the `SimpleHeaderConverter` is used to serialize header values as strings without schemas.

Unit and integration tests are added for `ConnectHeader` and `ConnectHeaders`, the two implementation classes for headers. Additional test methods are added for the methods added to the `Converter` implementations. Finally, the `ConnectRecord` object is already used heavily, so only limited tests need to be added while quite a few of the existing tests already cover the changes.

Author: Randall Hauch <rhauch@gmail.com>

Reviewers: Arjun Satish <arjun@confluent.io>, Ted Yu <yuzhihong@gmail.com>, Magesh Nandakumar <magesh.n.kumar@gmail.com>, Konstantine Karantasis <konstantine@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io>

Closes #4319 from rhauch/kafka-5142-b
2018-01-31 10:40:24 -08:00
..
documentation MINOR: Improve Streams Dev Guide content on web docs 2017-12-21 11:15:54 -08:00
images MINOR: Improve Streams Dev Guide content on web docs 2017-12-21 11:15:54 -08:00
js MINOR: Update docs for new version 2017-11-03 08:51:44 -07:00
streams KAFKA-3625: Add public test utils for Kafka Streams (#4402) 2018-01-29 17:21:48 -08:00
api.html MINOR: Improve versioning in docs when a full version is required 2017-07-07 14:41:54 +01:00
configuration.html Fix wrong property mentioned in doc; Author: Praveen K Palaniswamy <yourspraveen@gmail.com> 2018-01-02 10:07:54 -08:00
connect.html KAFKA-5142: Add Connect support for message headers (KIP-145) 2018-01-31 10:40:24 -08:00
design.html KAFKA-4711: fix docs on unclean.leader.election.enable default 2017-07-24 12:06:12 -07:00
documentation.html MINOR: Update docs for new version 2017-11-03 08:51:44 -07:00
ecosystem.html MINOR: Improve introduction section in docs to better cover connect and streams. Make uses and ecosystem pages stand alone. 2016-09-28 16:30:21 -07:00
implementation.html KAFKA-6157; Fix repeated words words in JavaDoc and comments. 2017-11-05 18:00:43 -08:00
introduction.html MINOR: kafka-site introduction section improvements 2017-11-15 14:32:00 -08:00
migration.html MINOR: add architecture section and configure / execution for streams 2017-02-09 19:13:23 -08:00
ops.html MINOR: Update consumer group command documentation with additionally supported options (#4462) 2018-01-25 09:25:29 -08:00
protocol.html MINOR: add architecture section and configure / execution for streams 2017-02-09 19:13:23 -08:00
quickstart.html MINOR: Improve a Windows quickstart instruction 2017-10-26 13:46:11 -07:00
security.html MINOR: Add authorizer.class.name to the security section in documentation (#4310) 2018-01-26 11:40:35 -08:00
toc.html HOTFIX: missing imports and version on web docs 2017-08-11 13:53:47 -07:00
upgrade.html KAFKA-5142: Add Connect support for message headers (KIP-145) 2018-01-31 10:40:24 -08:00
uses.html Update docs to reflect kafka trademark status 2017-10-05 13:31:18 -07:00