Cumulocity IoT SDK/Java client supports /group/* API methods?

What product/components do you use and which version/fix level are you on?

Cumulocity IoT Microservice SDK / Cumulocity IoT Java Client 1009.0.12

Is your question related to the free trial, or to a production (customer) instance?

no

What are you trying to achieve? Please describe it in detail.

We’re trying to find out if the Microservice SDK/Java client offers methods to access the REST APIs to

We couldnt find the corresponding classes/methods in the java client and wonder if someone might be able to help us here? Maybe there are added in a more recent version of the client?

Regards
Michael

1 Like

These REST APIs are not directly supported by the SDK. You will have to use e.g. the RestConnector to do the call yourself. Here is an example at least for the first of the calls you are looking for:

2 Likes

Thanks @Harald_Meyer! We’ll look into this solution!
In the meanwhile we started implementing the REST calls using a org.springframework.web.client.RestTemplate. Do you know the main differences or dis/advantages between the two solutions?

Regards
Michael

The main benefit of RestConnector is that is is managed by the Microservice SDK so you do not have to care about credentials. It is somewhat limited especially when it comes to post and put methods as it expects to interact with the Cumulocity API. So parameters and return types have to implement ResourceRepresentation.

Note that Spring Framework’s RestTemplate is in maintenance mode. Instead you can for example also use the HttpRequest implementation of Java.

1 Like

The official successor of RestTemplates is the WebClient Spring 5 WebClient | Baeldung

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.