quarkusio/quarkus · error · IllegalArgumentException

Unsupported compressor '

Error message

Unsupported compressor '

What it means

Quarkus's buildCompressors substitution validates the quarkus.mongodb.compressors config in native mode and throws IllegalArgumentException for any compressor name other than zlib or snappy (or empty). It indicates an invalid or misspelled compressor name in configuration.

Source

Thrown at extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/graal/MongoClientSubstitutions.java:61

}

@TargetClass(ConnectionString.class)
final class ConnectionStringSubstitution {

    @Substitute
    private List<MongoCompressor> buildCompressors(final String compressors, @Nullable final Integer zlibCompressionLevel) {
        List<MongoCompressor> compressorsList = new ArrayList<>();

        for (String cur : compressors.split(",")) {
            if (cur.equals("zlib")) {
                MongoCompressor zlibCompressor = MongoCompressor.createZlibCompressor();
                zlibCompressor = zlibCompressor.withProperty(MongoCompressor.LEVEL, zlibCompressionLevel);
                compressorsList.add(zlibCompressor);
            } else if (cur.equals("snappy")) {
                // DO NOTHING
            } else if (!cur.isEmpty()) {
                throw new IllegalArgumentException("Unsupported compressor '" + cur + "'");
            }
        }

        return unmodifiableList(compressorsList);
    }

}

@TargetClass(UnixServerAddress.class)
final class UnixServerAddressSubstitution {

}

@TargetClass(SocketStreamFactory.class)
final class SocketStreamFactorySubstitution {

    @Alias
    private InetAddressResolver inetAddressResolver;

View on GitHub (pinned to e1c734241f)

Solutions

  1. Fix the value to one of: zlib, snappy (ignored in native), or empty string
  2. Use quarkus.mongodb.compressors=zlib for native-compatible compression
  3. Clear the property entirely to disable compression

Example fix

// before
quarkus.mongodb.compressors=zstd
// after
quarkus.mongodb.compressors=zlib
Defensive patterns

Strategy: validation

Validate before calling

Set<String> allowed = Set.of("zlib", "snappy", "");
for (String c : compressorsProperty.split(",")) {
    if (!allowed.contains(c.trim())) {
        throw new IllegalArgumentException("Unknown compressor: " + c + "; allowed: zlib, snappy");
    }
}

Try / catch

try {
    mongoClient = buildFromConfig();
} catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("Unsupported compressor")) {
        log.error("Bad quarkus.mongodb.compressors value; using zlib");
    } else throw e;
}

Prevention

When it happens

Trigger: Setting quarkus.mongodb.compressors to a value like 'zlip', 'snappyx', 'deflate', or any non-empty string other than zlib/snappy; the substitution parses each comma-separated entry and rejects unknown names.

Common situations: Typo in application.properties; copying a compressor list from the MongoDB URI docs (e.g. 'zstd') that Quarkus native substitution does not support; including trailing entries like 'disabled'.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/dc8769bbb06d55ed. Report an issue: GitHub.