diff --git a/docs-java/features/connectivity/001-btp-destination-service.mdx b/docs-java/features/connectivity/001-btp-destination-service.mdx index 45255c67a4..28b189fa74 100644 --- a/docs-java/features/connectivity/001-btp-destination-service.mdx +++ b/docs-java/features/connectivity/001-btp-destination-service.mdx @@ -301,3 +301,20 @@ If that behavior is not desired, you may disable the change detection mode: ```java DestinationService.Cache.disableChangeDetection(); ``` + +### Destination PreLookup Check + +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. +This check first searches for the desired destination in the list of all available destinations (via a call to `DestinationService.getAllDestinationProperties`). +It will fail the `tryGetDestination` call without actually calling the destination directly if the destination is not present in the response of `DestinationService.getAllDestinationProperties`. + +:::info Regarding Fragments +This check does not account for fragments. +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`. +::: + +If that behavior is not desired it can disabled via + +```java +DestinationService.Cache.disablePreLookupCheck(); +```