Guaranteed delivery requests, sent with the tpf_publish_data API, do not have the ability to send additional metadata along with requests, without including it as part of the message data. APAR PJ48074 provides support to include custom Kafka headers on a guaranteed delivery request. Kafka headers are key-value pairs that you can attach to Apache Kafka messages to provide additional metadata or information about the message. The headers are stored separately from the data payload in the message, which provides easy access to the additional metadata.
To publish custom Kafka headers with your message data, update your applications to use the tpf_publish_data_ext API. Existing guaranteed delivery requests that are sent with the tpf_publish_data API continue to function; however, to include a custom Kafka header, you must use the tpf_publish_data_ext API. With tpf_publish_data_ext, you can optionally send a user data field as well as Kafka headers.
If the <TopicHandler> element in the JAM descriptor is set to com.ibm.tpf.DefaultPublishHandler, the custom Kafka headers are sent with messages and can be accessed by Kafka consumers. The user metadata field is intended for use on the z/TPF system. User metadata is not sent by the com.ibm.tpf.DefaultPublishHandler topic handler, but the data is accessible and can be customized for different use cases.
For more information about APAR PJ48074, see the APEDIT.