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: 
HenningH
Product and Topic Expert
Product and Topic Expert
439
The new version of SAP Cloud SDK is here! All 3 major SDK components received significant updates. In this post, we'll guide you through key improvements, highlights, and updates path. Feel free to jump directly to the respective component's section:



SAP Cloud SDK for Java 3.27.0


 

Quick links

A new and customizable HttpClient factory


Some applications that use the SAP Cloud SDK may require very specific properties on their HTTP client connection. Wth the latest release it is possible to easily adjust the DefaultHttpClientFactory instance, that is exposed through HttpClientAccessor. Changes that happen in this API also affect the internal requests through the SAP Cloud SDK.

Within a few lines of code the custom properties can be established, like time-out duration and maximum number of concurrent connections. Alternatively the application developer can provide their very own implementation by inheriting from the existing factory class and overriding the specific accessors.

A quick modification of default values can be achieved by using the builder pattern API:
HttpClientFactory factory = DefaultHttpClientFactory.builder()
.timeoutMilliseconds(60000)
.maxConnectionsPerRoute(100)
.maxConnectionsTotal(200)
.build();

HttpClientAccessor.setHttpClientFactory(factory);

At any point of the application runtime the application may call this accessor implicitly or explicitly:
HttpClient httpClient = HttpClientAccessor.getHttpClient();

When a destination was used to call the accessor it would look like this:
HttpDestination destination = DestinationAccessor.getDestination("MyDestination").asHttp();
HttpClient httpClient = HttpClientAccessor.getHttpClient(destination);

For more details on what's changed refer to the release notes.

How to update?


Navigate to a root folder of your project and find a pom.xml file. Bump the version of com.sap.cloud.sdk dependency to 3.26.0 similar to the XML code snippet below and you're done! Mind, because of Maven Central relying on CDN it takes a bit of time for new maven module to be distributed.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.sap.cloud.sdk</groupId>
<artifactId>sdk-bom</artifactId>
<version>3.27.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
<!-- possibly further managed dependencies ... -->
</dependencyManagement>

If for some reason your IDE hasn't fetched updated dependency version, run mvn clean install from the command line in the root directory of your project.

SAP Cloud SDK for JavaScript


 

Quick links


Experimental OData v4 client gets new features released


With the latest release, we provided support for enum types. Check the code snippet below on how to use it.
TestEntity.builder()
.enumProperty(TestEnumType.Member1)
.build()

where TestEnumType is generated.

For previously unsupported edm types like Edm.Geography, we introduced a type called Edm.Any, so that these properties are not ignored. However, type safe features like url conversion are not supported.

Major improvement



  • Special characters like ' (single quotes), (space) and ä (umlaut) are encoded properly when used in the Filter.

  • When both destination and the custom request config contain authorization headers, a warning is logged with the information about which one is used.


How to update?


To update the version of the SAP Cloud SDK for JavaScript used in an existing project, use the command npm update in the root folder of your module. Note that this will also update other modules unless you explicitly specify which packages to update. If you want to check beforehand what will change, use npm outdated.

Additionally, you can consult NPM for more information on version history and update path.

SAP Cloud SDK for Continuous Delivery


Quick links

In this release, we have removed the option to specify an NPM registry specifically for packages by SAP (scope @Sisn). This is no longer required, as all packages by SAP are now available from the standard public NPM registry. You can safely remove the configuration option sapNpmRegistry.

How to update?


If you are using the pipeline with a fixed version (as recommended since v7), update the continuous delivery toolkit with the following command, that you run on the server hosting the cx-server:
./cx-server update image

Feedback


We hope you enjoy developing with SAP Cloud SDK! To help us further improve give your ideas and suggestions in the comments to this blog or send them to cloudsdk@sap.com.

All the best,

SAP Cloud SDK Team