Skip to content

java.io.EOFException: Unexpected end of ZLIB input stream on getMessageDetails due to HTTP/1.1 Chunked Encoding vs GZIP Trailer conflict #81

@RaulPampliegaMayoral

Description

@RaulPampliegaMayoral

Describe the bug
When calling ApiClient.getMessageDetails(messageId) to retrieve outbound email details with large bodies, the SDK intermittently throws a java.io.EOFException: Unexpected end of ZLIB input stream during JSON deserialization.

Expected behavior
I expect the 200 code to be returned. Instead we get an exception

Image

Java (please complete the following information):

  • Java 11
  • Postmark client: 1.11.1

Additional context
To isolate the root cause, we built a custom wrapper extending ApiClient that splits the transport layer into two implementations using Apache HttpClient 5:

HTTP/1.1 Pathway: Using the classic blocking CloseableHttpClient.

HTTP/2 Pathway: Using the reactive/async CloseableHttpAsyncClient (which natively supports HTTP/2).

Results:

HTTP/1.1 Path: Consistently fails with java.io.EOFException: Unexpected end of ZLIB input stream when parsing large messages.

HTTP/2 Path: Works flawlessly for the exact same messageId

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions