spring-projects / spring-ws

Spring Web Services
https://spring.io/projects/spring-ws
Apache License 2.0
318 stars 309 forks source link

Add support for Apache HttpClient 5.0 #1164

Closed mdeinum closed 1 year ago

mdeinum commented 3 years ago

Current Apache Http Client 4.x is supported however there is also Apache Http Client 5.0 (and I believe 5.1 is in the making), which contains some breaking changes. Might be worthwhile to add support for Http Client 5.0 next to the 4.5.

Or add some documentation on how to configure the Apache Http Client using the ClientHttpRequestFactory abstraction in Spring itself to configure the Apache Http Client, this would save adding additional support into this and use the abstraction from Spring itself instead.

zielarz25 commented 1 year ago

+1 It becomes even more important now, when spring-mvc 6.x requires Apache Http Client 5.1+, but spring-ws still needs httpclient 4.x, resulting in some projects having two similar dependencies, potentially conflicting ones

mdeinum commented 1 year ago

You don't need to use the http client v4, as mentioned you can also use the ClientHttpRequestFactory (the infrastructure used by the RestTemplate) and you can use any supported version. Maybe that should become the default instead of have different implementation for different clients.

gregturn commented 1 year ago

Apparently, there are some official guides for migrating: https://hc.apache.org/httpcomponents-client-5.2.x/migration-guide/index.html

I need to study them to ensure we are properly aligning with their expectations.

gregturn commented 1 year ago

@artemptushkin I invite you to track this ticket on our progress towards HttpClient 5 support.

gregturn commented 1 year ago

As a reminder, this ticket is aimed at ADDING support for HttpClient 5, not breaking current users presently on HttpClient 4.x.

I will further check what Spring Framework is doing to see whether or not adding such support would dictate deprecating HttpClient 4 support or not.

daromnik commented 1 year ago

Hello, is there any news on this issue ?

gregturn commented 1 year ago

I did a first cut implementing it, and the code compiled, but the test cases all broke with some mysterious "Stream already closed" exception that I have yet to debug. I'm not sure if it's how I'm using the code, or if it is simply a false expectation in the test cases that needs to be shook out.

Facedancer1984 commented 1 year ago

Hello. Are there any updates on this issue?

morgan-root14 commented 1 year ago

@gregturn Is there any update on this? Will 4.0.3 allow compatibility with Http Client 5 for the HttpComponentMessageSender?

daromnik commented 1 year ago

Hi, is there any news?

gregturn commented 1 year ago

BTW, if anyone wants to investigate working up a pull request implements an Apache HttpClient 5.0-based HttpComponentMessageSender, I'm open to contributions!

cachescrubber commented 1 year ago

@gregturn Please see and review #1356.

gregturn commented 1 year ago

Thanks @cachescrubber!

Unfortunately, we can't drop any deprecated code in this release, but we're tracking removal on #1321. I added the components you removed back to your commit, and then added an additional polishing commit.

gregturn commented 1 year ago

That’s merged to main. Thanks!

artemptushkin commented 1 year ago

@gregturn can you please let me know when 4.0.5 will be released approximately? I tested on the snapshot - all good with me, thank you here

artemptushkin commented 1 year ago

@gregturn sorry for pinging, any plans regarding the release 4.0.5? Really waiting it, thank you

amalajone commented 1 year ago

Yeah we are waiting for 4.0.5 ws-core

Persi commented 1 year ago

@gregturn As Release 4.0.5 is currently just blocked by a documentation issue, would it be possible to move that issue to next release and create 4.0.5? This is a blocker for migration to Spring Boot 3 for everybody who uses spring-ws with Spring Boot.

gregturn commented 1 year ago

This issue has been released via https://github.com/spring-projects/spring-ws/releases/tag/v4.0.5. It should be picked up in the next release of Spring Boot.

ammu-n15 commented 11 months ago

Can anyone share me the code for HttpComponentsMessageSender with apache http5 support for SSL context and connection pooling

maryZil commented 7 months ago

I use version 4.0.10 - its does not work

mi9rom commented 7 months ago

Use HttpComponents5MessageSender instead of HttpComponentsMessageSender

maryZil commented 7 months ago

Yes! Thanks.

VijayGogineni commented 7 months ago

@mi9rom thanks for the suggestion, what is the import for the HttpComponents5MessageSender? I use springboot version 3. will this HttpComponents5MessageSender work for me?

snigdhasasmal07 commented 5 months ago

@VijayGogineni @maryZil @mi9rom are there any solutions you found for these issue?