Does Cloud SDK Java support Service to Service call (e.g. micro service A issues OData call to micro service B) inside Deployment with Confident environment? I do not see anything about this part in the documentation and after going through the doc it seems we have to use destination to issue the OData call but this is not the case inside DwC env. And also I don't know how to handle mTLS, DwC headers propagation and target micro service route determination when using Cloud SDK instead of RestTemplate. Thanks.
Asked
Active
Viewed 48 times
1 Answers
1
Yes, this is possible. You can use:
DefaultHttpDestination
.builder("https://your.service/to/call")
// this enables mTLS
.securityConfiguration(SecurityConfigurationStrategy.FROM_PLATFORM)
// this forwards the DwC Headers
.headerProviders(DwcHeaderProvider.getInstance())
.build();
You can find the documentation here (link available only SAP internally).

MatKuhr
- 505
- 4
- 13
-
Hi MatKuhr, thanks very much for the information. When using RestTemplate we normally create MockBean of RestTemplate for our unit tests or integration tests. Do you happen to know how we can do unit tests or integration tests if we switch to this Cloud SDK approach? – Eric Jiang Feb 17 '23 at 10:26
-
Hi Eric, the usual approach we follow is either to use WireMock or directly mocking the `HttpClient` given from the `HttpClientAccessor`. In the end it depends on what you want to test. For a full integration test running against megaclite you can follow the description in the link of Matthias above, where the DwC team describes how to set it up. – Christoph Schubert Feb 21 '23 at 08:58