Skip to content

feat: add a GZIP message compression codec #11448

Open

Description

@Metastarx

功能说明:Adds GZIP as a selectable message body compression codec alongside the existing LZ4, ZSTD and ZLIB codecs. GZIP is implemented entirely with the JDK (java.util.zip.GZIPOutputStream / GZIPInputStream), so no new dependency, LICENSE entry or IP clearance is required, and its framing is what nearly every other language and command line tool produces by default, which makes compressed payloads interchangeable with external producers and consumers. It mirrors the existing codec family exactly.

Activity

  1. RockteMQ-AI commented on Oct 16, 2026

    @RockteMQ-AI
    Contributor

    Issue Evaluation

    Category: type/enhancement | Status: Evaluated

    Feasibility: Feasible — straightforward addition
    Scope: common/compression module (4 core files + tests)
    Compatibility: Forward-compat risk for older clients/brokers (same as when ZSTD was added)

    The existing compression infrastructure (CompressionType enum, Compressor interface, CompressorFactory) is well-designed for extension. Adding GZIP requires:

    1. New GzipCompressor.java implementing Compressor (JDK GZIPOutputStream/GZIPInputStream — zero new dependencies)
    2. Add GZIP(4) to CompressionType enum + MessageSysFlag constant
    3. Register in CompressorFactory
    4. Tests

    No changes needed in client/broker/store layers — producer resolves via CompressionType.of() + getCompressionFlag(), consumer decompresses via MessageDecoder/factory, broker stores opaque bytes.

    Concerns:

    • Older clients/brokers will throw RuntimeException on unknown compression type value 4 (same forward-compat pattern as ZSTD addition)
    • GZIP offers weaker ratio/speed than ZSTD/LZ4 — primary value is ecosystem interoperability (standard format supported by virtually every language/tool)

    Overall a clean, low-risk enhancement if the interop benefit is desired.


    Automated evaluation by github-manager-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions