conduktor.io ↗

Subject Name Must Follow -key / -value Convention

Reject subjects that do not end in -key or -value (TopicNameStrategy).

Rationale

Confluent SR client libraries default to TopicNameStrategy (`<topic>-value`). Teams who register subjects as `payments-schema-v3` find their consumers cannot auto-resolve and have to hardcode subject names, which breaks every time the topic is renamed. Enforce the convention at the registry, not in the readme.

Pattern

metadata.name ends with "-key" or "-value"

Examples

payments.tx.v1-value
clickstream.events-key
payments_schema_v3
MyAvroSchema

Parameters

NameDefaultDescription
allowed_suffixes ["-key","-value"] Allowed subject suffixes.

Implementation

Drop this YAML into Conduktor Console as a ResourcePolicy, then link it from an ApplicationInstance, Application, or KafkaCluster.

Conduktor ResourcePolicy
# Conduktor self-service ResourcePolicy
---
apiVersion: self-serve/v1
kind: ResourcePolicy
metadata:
  name: subject-naming-strategy-topic-value
spec:
  targetKind: Subject
  description: subject name must end with -key or -value (TopicNameStrategy)
  rules:
    - condition: 'metadata.name.endsWith("-key") || metadata.name.endsWith("-value")'
      errorMessage: "subject name must end with \"-key\" or \"-value\" (TopicNameStrategy) — other suffixes break auto-resolution in standard SR clients"

Related policies

Try Conduktor Console

Enforce policies like this across your team — central audit history, pre-commit guardrails, ApplicationInstance bindings. 5-min Docker install.

Get Started →