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

- **ID:** `kafka/unsupported-compression-type`
- **Domain:** kafka
- **Category:** protocol_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## 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.

## Workarounds

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`.** (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`.
   ```

## Dead Ends

- **** — Upgrading the client library without changing broker config (e.g., enabling zstd on broker) still fails because the broker rejects unknown compression. (75% 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. (60% fail)
