Skip to content

Fix custom config with older HttpClient - #480

Closed
snicoll wants to merge 1 commit into
spring-projects:masterfrom
snicoll:SPR-11442
Closed

snicoll wants to merge 1 commit into
spring-projects:masterfrom
snicoll:SPR-11442

Conversation

@snicoll

@snicoll snicoll commented Mar 4, 2014

Copy link
Copy Markdown
Member

Since HttpClient 4.3, custom configuration such as the connection timeout and the socket timeout are set in a RequestConfig object stored in the HttpContext.

Unfortunately, older HttpClients are not supporting this infrastructure and new clients throw an exception when the deprecated API is used.

This commit detects if the client is an "old" implementation and set the configuration through the deprecated means to restore full backward compatibility with these features.

Note that because of the -WError flag, no import on deprecated classes are allowed which is the reason why I used FQNs

Since HttpClient 4.3, custom configuration such as the connection
timeout and the socket timeout are set in a RequestConfig object
stored in the HttpContext.

Unfortunately, older HttpClients are not supporting this
infrastructure and new clients throw an exception when the
deprecated API is used.

This commit detects if the client is an "old" implementation and
set the configuration through the deprecated means to restore
full backward compatibility with these features.

Issue: SPR-11442
@snicoll

snicoll commented Mar 10, 2014

Copy link
Copy Markdown
Member Author

merged

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant