Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Establish connect timeout to remote server is not work with HttpComponents5MessageSender #1436

Closed
phuc98ute opened this issue Oct 16, 2024 · 0 comments · Fixed by #1437
Closed

Comments

@phuc98ute
Copy link

phuc98ute commented Oct 16, 2024

Hi team,
I am trying to use a new class HttpComponents5MessageSender instead old class HttpComponentsMessageSender this have the same 2 functions: setConnectionTimeout and setReadTimeout

I debugged in the logic code and found that the connection timeout from new class HttpComponents5MessageSender will passed to HttpComponents5ClientFactory. And based on the HttpComponents5ClientFactory doc page, the function setConnectionTimeout should be "Sets the timeout until a connection is established."
image

However, when dig dive into the logic code, I found that the first logic implement for HttpComponents5ClientFactory is implement as expected when set the connectTimeout for RequestConfig at here, at this issue.

But on the version v4.0.5, and at this commit, the function setConnectTimeout is replaced by setConnectionRequestTimeout.
However, the 2 function are not the same:

  • setConnectionRequestTimeout: the connection lease request timeout used when requesting a connection from the connection manager.
  • setConnectTimeout: Determines the timeout until a new connection is fully established. This may also include transport security negotiation exchanges such as SSL or TLS protocol negotiation).

The result is the connect timeout is not working as expected when migrating from HttpComponentsMessageSender to HttpComponents5MessageSender and keeping both functions setConnectionTimeout, setReadTimeout. And the connect timeout will default to 2 minutes despite a specific configuration for HttpComponents5MessageSender.setConnectionTimeout

@phuc98ute phuc98ute changed the title Establish connect timeout to remote server is not work with HttpComponents5ClientFactory Establish connect timeout to remote server is not work with HttpComponents5MessageSender Oct 16, 2024
corneil added a commit to corneil/spring-ws that referenced this issue Nov 4, 2024
…ad setConnectionRequestTimeout to restore the behaviour as before.

Fixes spring-projects#1436
@corneil corneil self-assigned this Nov 4, 2024
@corneil corneil closed this as completed in b45071b Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants