kafka protocol_error ai_generated partial

org.apache.kafka.common.errors.UnsupportedCompressionTypeException: The compression type is not supported.

ID: kafka/unsupported-compression-type

Also available as: JSON · Markdown · 中文
85%Fix Rate
87%Confidence
1Evidence
2024-02-28First Seen

Root Cause

The broker or client received a message with a compression codec (e.g., lz4, snappy, zstd) that is not enabled or supported in the broker configuration.

generic

中文

代理或客户端收到带有压缩编解码器(例如 lz4、snappy、zstd)的消息,该编解码器在代理配置中未启用或不受支持。

Official Documentation

https://kafka.apache.org/documentation/#compression

Workarounds

  1. 85% success Enable the compression type in broker's server.properties: `compression.type=producer` (auto-detect) or explicitly set `zstd` if using zstd. Then restart the broker. Example: `echo 'compression.type=zstd' >> config/server.properties && kafka-server-stop.sh && kafka-server-start.sh config/server.properties`.
    Enable the compression type in broker's server.properties: `compression.type=producer` (auto-detect) or explicitly set `zstd` if using zstd. Then restart the broker. Example: `echo 'compression.type=zstd' >> config/server.properties && kafka-server-stop.sh && kafka-server-start.sh config/server.properties`.

中文步骤

  1. Enable the compression type in broker's server.properties: `compression.type=producer` (auto-detect) or explicitly set `zstd` if using zstd. Then restart the broker. Example: `echo 'compression.type=zstd' >> config/server.properties && kafka-server-stop.sh && kafka-server-start.sh config/server.properties`.

Dead Ends

Common approaches that don't work:

  1. 75% fail

    Upgrading the client library without changing broker config (e.g., enabling zstd on broker) still fails because the broker rejects unknown compression.

  2. 60% fail

    Disabling compression on the producer without fixing the broker may hide the symptom but loses efficiency; the root cause is the broker not supporting the codec.