Skip to content

Commit 228d000

Browse files
authored
Java 5.25.0: Pre-Lookup check (circuit breaker) (#2327)
* Java 5.25.0: Pre-Lookup check (circuit breaker) * lint * lint * small change
1 parent 9f3d3b5 commit 228d000

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs-java/features/connectivity/001-btp-destination-service.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,3 +301,20 @@ If that behavior is not desired, you may disable the change detection mode:
301301
```java
302302
DestinationService.Cache.disableChangeDetection();
303303
```
304+
305+
### Destination PreLookup Check
306+
307+
In order to decrease the amount of unnecessary calls to non-existent destinations, the `DestinationService` performs a pre-lookup check when calling a single destination through `tryGetDestination()` by default.
308+
This check first searches for the desired destination in the list of all available destinations (via a call to `DestinationService.getAllDestinationProperties`).
309+
It will fail the `tryGetDestination` call without actually calling the destination directly if the destination is not present in the response of `DestinationService.getAllDestinationProperties`.
310+
311+
:::info Regarding Fragments
312+
This check does not account for fragments.
313+
A non-existing fragment will still lead to an HTTP call and subsequent `DestinationNotFoundException` unless the additional header `{@code X-fragment-optional: true}` is set via `DestinationOptions`.
314+
:::
315+
316+
If that behavior is not desired it can disabled via
317+
318+
```java
319+
DestinationService.Cache.disablePreLookupCheck();
320+
```

0 commit comments

Comments
 (0)