Record Transcode Produce

Accept JSON and Avro records and store them as Avrov1.3+

Use a schema registry with schema_type any so clients can produce either JSON or Avro, and store only Avro in the backend cluster.

The parent Schema Validation policy validates the record value against a schema registry whose schema_type is any, so a client can produce records in either JSON or Avro.

With output_format: avro, this policy converts JSON records to Avro and leaves records that are already Avro unchanged. It looks up the target Avro schema in the same registry by subject and version, and prefixes converted records with the schema reference in the Confluent wire format, so any Confluent-compatible consumer can deserialize them.

This is useful while producers migrate from JSON to Avro and both formats are in flight for a period of time.

Prerequisites

Environment variables

  • PARENT_POLICY_ID: The UUID of the parent Schema Validation policy.

Set up the policy

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!