Skip to content

Jersey client connection timeout doubled when posting entity #26750

Closed
@oleborup

Description

@oleborup

When using Jersey client in a Spring Boot context the connection timeout is the double of what is defined when posting an entity. In short:

client.property(ClientProperties.CONNECT_TIMEOUT, 2000);
invocationBuilder.post(null); // correct connection timeout of 2 sec
invocationBuilder.post(Entity.json(request)); // double connection timeout 4 sec

The problem started with Jersey version 2.31. This project demonstrates the issue with a minimal example: https://github.com/oleborup/jersey-client-connection-timeout

I have not been able to reproduce this in a non Spring Boot context only relying on Jersey dependencies, therefore trying to post here.

Spring Boot version: 2.5.0
Java version: OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions