Skip to main content
Quick navigation

Topic required schema id policy

Introduction

Ensuring that all records sent through your Kafka system have a schema associated with them ensures data in a known format for your Kafka consumers.

Records with missing schemas can cause application outages, as consumers may be unable to process the unexpected record format.

The Topic required schema id policy interceptor ensures that all records produced to Kafka have a schema set

See more about schema registry and schema-id here

What happens when sending an invalid record

Topic required schema id policy interceptor will return the following errors when an invalid record is sent:

key
schemaIdRequired: trueWhen sending a record without schemaId: Request parameters do not satisfy the configured policy. SchemaId is required.
schemaIdRequired: falseWhen sending a record with schemaId: Request parameters do not satisfy the configured policy. SchemaId is not allowed.

Configuration

keytypedefaultdescription
topicString.*Topics that match this regex will have the interceptor applied
schemaIdRequiredBooleanRecords must/must not have schemaId
actionActionBLOCKAction to take if the value is outside the specified range

Action

  • BLOCK → when fail, save in audit and return error.
  • INFO → execute API with wrong value, save in audit.

Example

{
"name": "myTopicRequiredSchemaIdPolicyInterceptor",
"pluginClass": "io.conduktor.gateway.interceptor.safeguard.TopicRequiredSchemaIdPolicyPlugin",
"priority": 100,
"config": {
"topic": "topic_1.*",
"schemaIdRequired": true,
"action": "BLOCK"
}
}