greyp9 commented on code in PR #6131: URL: https://github.com/apache/nifi/pull/6131#discussion_r934782331
########## nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-processors/src/main/resources/docs/org.apache.nifi.processors.kafka.pubsub.PublishKafkaRecord_2_6/additionalDetails.html: ########## @@ -189,5 +189,77 @@ <h3>SASL_SSL</h3> See the SSL section for a description of how to configure the SSL Context Service based on the ssl.client.auth property. </p> + <h2>Record Key Output</h2> + <div> + <p>This processor includes optional properties that control the serialization of the key into the target + Kafka record.</p> + <ul> + <li>'Publish Strategy'</li> + <li>'Record Key Writer'</li> + </ul> + + <p>'Publish Strategy' controls the mode used to convert the FlowFile record into a Kafka record.</p> + <ul> + <li>'Use Content as Record Value' (the default) persists the record key as a byte array.</li> + <li>'Use Wrapper' persists the record key as a record.</li> + </ul> + + <p>If Publish Strategy 'Use Wrapper' is enabled, an additional processor configuration property is + activated: 'Record Key Writer'.</p> + + <p>'Record Key Writer', if enabled, serializes the NiFi record key field into the Kafka record using the + specified implementation of the NiFi 'RecordSetWriter' interface. This may be used to emit the key field + as JSON, Avro, XML, or some other data format, where it may be used in the decision-making process of + downstream data processing (including that available in ConsumeKafkaRecord_2_6). If not defined, the + default implementation serializes the record key as an unmodified byte array (unchanged from previous + versions of the processor).</p> + +<p>Here is an example of a Kafka Record that is emitted by <code>JsonRecordSetWriter</code> when strategy "Use Wrapper" is active:</p> Review Comment: Updated wrapper record to include metadata fields topic and timestamp. If I pulled partition up to the beginning of the method, that could be included as well, but I don't know whether that would affect the application of the partition strategy. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org