You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-java/environments/kyma.mdx
+67-4Lines changed: 67 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -659,7 +659,20 @@ Apply the YAML with `kubectl apply -n` into the namespace of your application po
659
659
660
660
### Executing Requests
661
661
662
-
In your application you can now configure a destination to execute requests:
662
+
The SAP Cloud SDK offers two distinct approaches for executing requests through the Transparent Proxy in Kyma. Choose the approach that best fits your application's architecture and requirements.
The **TransparentProxyDestination Builder** approach provides explicit, fine-grained control over individual destination configurations. This is the recommended approach for most use cases as it offers maximum flexibility and clear configuration management.
667
+
668
+
### When to Use This Approach
669
+
670
+
- You need specific control over individual destination configurations
671
+
- You want to set custom headers or properties per destination
672
+
- You prefer explicit destination management
673
+
- You need different configurations for different destinations
674
+
675
+
### Implementation Examples
663
676
664
677
<Tabs
665
678
groupId="dynamic-dest"
@@ -670,6 +683,10 @@ In your application you can now configure a destination to execute requests:
670
683
]}>
671
684
<TabItem value="single">
672
685
686
+
**For Concrete SAP Destinations:**
687
+
688
+
Use this when connecting to a specific, pre-configured destination with a dedicated Destination Custom Resource.
`<destination-custom-resource-namespace>`can be omitted if the destination custom resource is created in the same namespace as the application workload.
702
723
:::
703
724
704
-
The code above shows an example how you can then use the `destination` object to perform an OData request against the system.
725
+
## Approach 2: Transparent Proxy Loader
726
+
727
+
The **Transparent Proxy Loader** approach provides centralized proxy configuration where **all destination requests** are automatically routed through a single registered gateway without requiring explicit destination builders.
728
+
729
+
### When to Use This Approach
730
+
731
+
- You want all destinations to automatically route through a single transparent proxy gateway
732
+
- You prefer a centralized, "set-it-and-forget-it" configuration approach
733
+
- You have many destinations that should all use the same proxy configuration
734
+
- You want to minimize code changes when migrating from traditional destination access
735
+
736
+
### Implementation Examples
737
+
738
+
**Step 1: Register the Transparent Proxy (typically during application startup):**
`<destination-custom-resource-namespace>` can be omitted if the destination custom resource is created in the same namespace as the application workload.
77
80
:::
78
81
79
-
###2. Gateway
82
+
#### Dynamic Destination Gateway
80
83
81
84
Allows you to connect to arbitrary SAP destinations you have access to.
82
85
As a prerequisite, you have to create a Gateway Destination Custom Resource inside the Kubernetes cluster.
1.**Missing destination name for gateway**: Ensure the destination name is provided as the first parameter to `.gateway(<destination-name>, <destination-custom-resource-name>.<destination-custom-resource-namespace>)`
181
-
2.**Tenant context not available**: Verify tenant information is properly set in the request context
182
-
3.**Authentication failures**: Check that authentication headers and parameters are correctly configured
183
-
4.**Network connectivity**: Verify that the Transparent Proxy is accessible from your environment
184
-
185
-
### Evaluating Transparent Proxy Headers
186
-
187
-
When using proxy servers it can be difficult to troubleshoot issues as it is often not obvious where exactly the error occurred.
188
-
For example, with the Transparent Proxy errors might occur on the target system (e.g. OData service), the Destination Service or the Transparent Proxy itself.
180
+
## Approach 2: Transparent Proxy Loader
189
181
190
-
To make troubleshooting easier the Transparent Proxy adds additional response headers to provide more information about where an error occurred.
191
-
For the above example of executing OData requests you can access the response headers as follows:
192
-
193
-
```java
194
-
try {
195
-
// execute OData request
196
-
} catch (ODataResponseException e) {
197
-
System.out.println(e.getHttpCode());
198
-
// the Transparent Proxy will attach additional response headers in case an error occurred
199
-
System.out.println(e.getHttpHeaders());
200
-
}
201
-
```
202
-
203
-
#### List of headers added by the Transparent Proxy
204
-
205
-
-`X-Error-Origin` - the source of the error
206
-
-`X-Proxy-Server` - the proxy server (Transparent Proxy)
207
-
-`X-Error-Message` - thorough error message
208
-
-`X-Error-Internal-Code` - set only when the source of the error is the XSUAA or Destination service.
209
-
The value is the HTTP code returned from one of these services.
210
-
-`X-Request-Id` is sent with the response in all requests, both successful and failed
182
+
The `TransparentProxy` class provides a `DestinationLoader` that enables routing **all destination traffic** through a single registered gateway host.
183
+
This approach provides centralized proxy configuration where all destination requests are automatically routed through the configured gateway without requiring explicit destination builders.
211
184
212
-
For more information, see [Troubleshooting](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/transparent-proxy-troubleshooting)
185
+
### When to Use This Approach
213
186
214
-
## Transparent Proxy Loader
187
+
Use the Transparent Proxy Loader when:
215
188
216
-
The `TransparentProxy` class is a `DestinationLoader` that enables routing all destination traffic through a single registered gateway host.
217
-
This provides a centralized approach to proxy configuration where all destination requests are automatically routed through the configured gateway.
189
+
- You want all destinations to automatically route through a single transparent proxy gateway
1.**Missing destination name for gateway**: Ensure the destination name is provided as the first parameter to `.gateway(<destination-name>, <destination-custom-resource-name>.<destination-custom-resource-namespace>)`
234
+
2.**Tenant context not available**: Verify tenant information is properly set in the request context
235
+
3.**Authentication failures**: Check that authentication headers and parameters are correctly configured
236
+
4.**Network connectivity**: Verify that the Transparent Proxy is accessible from your environment
237
+
238
+
### Evaluating Transparent Proxy Headers
239
+
240
+
When using proxy servers it can be difficult to troubleshoot issues as it is often not obvious where exactly the error occurred.
241
+
For example, with the Transparent Proxy errors might occur on the target system (e.g. OData service), the Destination Service or the Transparent Proxy itself.
242
+
243
+
To make troubleshooting easier the Transparent Proxy adds additional response headers to provide more information about where an error occurred.
244
+
For the above example of executing OData requests you can access the response headers as follows:
245
+
246
+
```java
247
+
try {
248
+
// execute OData request
249
+
} catch (ODataResponseException e) {
250
+
System.out.println(e.getHttpCode());
251
+
// the Transparent Proxy will attach additional response headers in case an error occurred
252
+
System.out.println(e.getHttpHeaders());
253
+
}
254
+
```
255
+
256
+
#### List of headers added by the Transparent Proxy
257
+
258
+
-`X-Error-Origin` - the source of the error
259
+
-`X-Proxy-Server` - the proxy server (Transparent Proxy)
260
+
-`X-Error-Message` - thorough error message
261
+
-`X-Error-Internal-Code` - set only when the source of the error is the XSUAA or Destination service.
262
+
The value is the HTTP code returned from one of these services.
263
+
-`X-Request-Id` is sent with the response in all requests, both successful and failed
264
+
265
+
For more information, see [Troubleshooting](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/transparent-proxy-troubleshooting)
266
+
256
267
## Related Documentation
257
268
258
269
-[HTTP Client](http-client) - For using destinations with HTTP clients
0 commit comments