conduktor.io ↗

Maximum Message Bytes Bound

max.message.bytes must not exceed 10 MB per topic.

Rationale

Very large Kafka messages kill throughput (one slow consumer stalls a partition) and signal the wrong tool. Bulk payloads belong in S3 with a Kafka pointer. 10 MB is a generous practical ceiling.

Pattern

max.message.bytes <= 10485760

Examples

max.message.bytes: 1048576 (1 MB)
max.message.bytes: 5242880 (5 MB)
max.message.bytes: 104857600 (100 MB)

Parameters

NameDefaultDescription
max_bytes 10485760 Maximum message size in bytes (default 10 MB).

Governs

This policy relates to the following Kafka configuration keys:

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
# Schema: https://docs.conduktor.io/platform/reference/resource-reference/self-service/#resourcepolicy
# spec.configs values are strings — wrap with int(string(...)) for numeric compare.
# NOTE: Conduktor Console inflates broker defaults into spec.configs at apply time,
# so the "key present" branch always fires. We assert the upper bound directly.
---
apiVersion: self-serve/v1
kind: ResourcePolicy
metadata:
  name: max-message-bytes-bound
spec:
  targetKind: Topic
  description: max.message.bytes must be <= 10 MB
  rules:
    - condition: '!("max.message.bytes" in spec.configs) || int(string(spec.configs["max.message.bytes"])) <= 10485760'
      errorMessage: "max.message.bytes > 10 MB — consider claim-check pattern with S3"

Try Conduktor Console

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

Get Started →