0

We currently upgrade our project to use Spring 6 & Spring Boot 3. We face some issues with the s4hana-connectivity dependency as it is still relying on org.apache.httpcomponents » httpclient:4.5.14. Are there any plans to upgrade to org.apache.httpcomponents.client5 » httpclient5:5.2.1 yet ?

Since Cloud SDK in its newest version should support Spring 6, I would have expected that the s4hana-connectivity package runs on Apache HTTP Client 5

Julian2611
  • 422
  • 3
  • 11

2 Answers2

1

Correct, SAP Cloud SDK currently only supports Apache HttpClient 4 as HTTP client library. Luckily you can have Apache HttpClient 4 and 5 active in your class path, at the same time.

This means, from SAP Cloud SDK perspective technically we see no immediate need for a fix or a workaround.

However, we are considering support for additional HTTP client libraries (e.g. Apache HttpClient 5) in the future with next major release(s). If you want to be considered stakeholder and future beta tester for this feature request, please let me know. Though, currently there is no schedule aligned.

Alexander Dümont
  • 903
  • 1
  • 5
  • 9
  • thanks for the quick answer. We currenly use the getHttpClient(HttpDestination) Api from the HttpClientAccessor. Subsequently we pass the client to some spring factory service that relies on the new Httpclient 5 type. So, we do not have any benefit from having both HttpClient 4 and 5 in the class path. – Julian2611 May 08 '23 at 09:01
  • Could you expand your question a bit with how you are actually using this spring factory? Are you using RestTemplate or do you want to use WebClient or something else entirely? – MatKuhr May 08 '23 at 11:42
  • yes we use RestTemplate in the end to enable a "behalf of" flow with custom authtentication – Julian2611 May 08 '23 at 14:48
0

While the answer from Alex is still correct, we are happy to announce that the SAP Cloud SDK for Java now (starting from version 4.20.0) officially has additional support for Apache Http Client version 5.

Users, who are interested in creating Spring's RestTemplate from a Destination can now use the new ApacheHttpClient5Accessor (module com.sap.cloud.sdk.frameworks:apache-httpclient5), which provides similar APIs as the regular HttpClientAccessor.

Please note: Internally, the SAP Cloud SDK for Java still relies on the Apache version 4 client. As a consequence, applications that run on Spring 6 will (in almost all cases) end up with both Apache versions on their class path.