Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
mkuhr-test
Advisor
Advisor
Today, we have released version 4.0.0 of the SAP Cloud SDK for Java. After three years since the release of version 3 and well over 70 minor version updates since then, this is the next major version of the SDK. It brings many improvements and new features while keeping most of the API stable to make updating as seamless as possible.

In this blog post, I want to share what is new, what has changed and how you can get started with the new version. For the technical details on how to update, please head to this dedicated guide.

Whats New?


So, what's new? With version 4 our goal is to make the SDK easier to use, more lightweight and better integrated. At the same time, updating an existing project that uses the SAP Cloud SDK should be as easy and effortless as possible.

Keeping that in mind, let's look at which improvements version 4 is bringing to your projects.

Easier Dependency Management


We reduced the amount of transitive dependencies the Cloud SDK brings into projects. By reducing the dependency footprint the SDK gets more light-weight, is easier to use with other frameworks like CAP and dependency conflicts become less likely. You can check the full list of removed dependencies here.

For customers using a Tomcat or TomEE container with the SAP Java Buildpack we also introduced a completely new BOM, dedicated to the SAP Java Buildpack. The BOM ensures all relevant dependencies have their version and scope set to be compatible with the Buildpack.

New ThreadContext and Thread Handling


The Cloud SDK uses a context object called ThreadContext to store the current tenant, user and other related information.

With version 4 this feature has received major changes:

  • We introduced a completely new API for running asynchronous tasks with the SDK

  • The ThreadContext can now conveniently be used with Spring's @Async feature

  • Asynchronous tasks are no longer bound to the lifecycle of the thread that scheduled them

  • The Cloud SDK now better integrates with CAP Framework and the Security Library

  • The APIs now bring more clarity and the underlying implementation is more robust


Here is an example of how you can obtain a destination asynchronously while preserving all tenant and user information:
Future<Destination> destinationFuture = ThreadContextExecutors.submit(
() -> DestinationAccessor.getDestination("my-destination"));

Make sure to check out all the details of these features on the full documentation.

Better Integration with Kubernetes Environments


Starting with version 4.0.0 the SAP Cloud SDK leverages a new library under the hood to access service bindings. With the new library all versions of the SAP BTP Service Operator are now supported. In particular this also means that the Kyma platform is now supported out of the box (except for on-premise connectivity).

Removal of Deprecated API


We not only added new functionality but also removed a lot of long deprecated API. Most notably we removed the dependency to the legacy SDK for Service Development (Service SDK), together with all API related to it. This completes the transition to our own OData client.

Among other deprecated APIs we also removed a substantial amount of legacy modules which were no longer used and only existed for compatibility. All of these changes helped sliming down the SDK and reducing the dependency footprint. Head over to the documentation for a full list of removed API and modules.

How to Update?


Good news: Updating is easy! Chances are you can update without significant code changes. Still, we compiled a detailed guide to help you update your existing projects.

To test the process we worked with a number of customers and were able to update their projects with either minimal or no code changes at all.

How long will Version 3 be Supported?


Don't worry, in case you can't update right away you can continue using version 3. It will continue to receive critical security patches.

However, new features and improvements will only be shipped to version 4. You can read more about the release strategy and support here.

Summary


With version 4 we bring even more features, better integration and easier usage to the SAP Cloud SDK. All of which while keeping API changes to a minimum for a seamless upgrade experience. So get started with version 4 of the SAP Cloud SDK for Java or update your current project with the detailed update guide.

Share Your Feedback


Do you have any questions on the new features? Or are you struggling with the upgrade? Don’t hesitate to share your feedback in the comments below, ask a question in the Q&A or to create a dedicated issue on our GitHub.

2 Comments
madhusudhanan
Discoverer
0 Kudos

Hi Matthias,

When will there be a support with Kyma Runtime for on-premise connectivity?

Regards,
Madhu

jschneider
Advisor
Advisor
0 Kudos
Hi Madhu,

we are currently investigating different options for enabling On-Premise connectivity from within a Kyma cluster.

If you like, you can already take a look at state of our documentation update: https://github.com/SAP/cloud-sdk/pull/1120

Please note that we are not done testing the described approach and, therefore, cannot guarantee functional correctness and/or completeness of the documentation.
Unfortunately, I cannot comment on a fixed schedule for when On-Premise connectivity will be fully support at the moment.

Best regards,
Johannes