From bb823945dfe131cfdf6c46a81cea1c0512f562d6 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Tue, 9 Dec 2025 15:06:57 +0100 Subject: [PATCH 1/4] Java 5.25.0: Pre-Lookup check (circuit breaker) --- .../connectivity/001-btp-destination-service.mdx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs-java/features/connectivity/001-btp-destination-service.mdx b/docs-java/features/connectivity/001-btp-destination-service.mdx index 45255c67a4d..ba328ad2dc8 100644 --- a/docs-java/features/connectivity/001-btp-destination-service.mdx +++ b/docs-java/features/connectivity/001-btp-destination-service.mdx @@ -301,3 +301,17 @@ If that behavior is not desired, you may disable the change detection mode: ```java DestinationService.Cache.disableChangeDetection(); ``` + +### Pre-Lookup 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 and fails the `tryGetDestination` call if the destination is not present without actually trying to call it directly. + +:::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(); +``` From 72e277e64c085eaf5a6dafc5ab5a75951cef7ed0 Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Tue, 9 Dec 2025 15:10:38 +0100 Subject: [PATCH 2/4] lint --- .../features/connectivity/001-btp-destination-service.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs-java/features/connectivity/001-btp-destination-service.mdx b/docs-java/features/connectivity/001-btp-destination-service.mdx index ba328ad2dc8..9f08332a897 100644 --- a/docs-java/features/connectivity/001-btp-destination-service.mdx +++ b/docs-java/features/connectivity/001-btp-destination-service.mdx @@ -302,13 +302,14 @@ If that behavior is not desired, you may disable the change detection mode: DestinationService.Cache.disableChangeDetection(); ``` -### Pre-Lookup Check +### 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 and fails the `tryGetDestination` call if the destination is not present without actually trying to call it directly. :::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`. +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 From 15ca9f5ce8d38bea898e83c06ef3440e0b32f95d Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Tue, 9 Dec 2025 15:15:55 +0100 Subject: [PATCH 3/4] lint --- docs-java/features/connectivity/001-btp-destination-service.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/docs-java/features/connectivity/001-btp-destination-service.mdx b/docs-java/features/connectivity/001-btp-destination-service.mdx index 9f08332a897..707a0595c31 100644 --- a/docs-java/features/connectivity/001-btp-destination-service.mdx +++ b/docs-java/features/connectivity/001-btp-destination-service.mdx @@ -313,6 +313,7 @@ A non-existing fragment will still lead to an HTTP call and subsequent `Destinat ::: If that behavior is not desired it can disabled via + ```java DestinationService.Cache.disablePreLookupCheck(); ``` From 40fabe6461a57133f645da28461b36af74dd94df Mon Sep 17 00:00:00 2001 From: Jonas Israel Date: Wed, 10 Dec 2025 14:55:42 +0100 Subject: [PATCH 4/4] small change --- .../features/connectivity/001-btp-destination-service.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs-java/features/connectivity/001-btp-destination-service.mdx b/docs-java/features/connectivity/001-btp-destination-service.mdx index 707a0595c31..28b189fa74e 100644 --- a/docs-java/features/connectivity/001-btp-destination-service.mdx +++ b/docs-java/features/connectivity/001-btp-destination-service.mdx @@ -305,7 +305,8 @@ 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 and fails the `tryGetDestination` call if the destination is not present without actually trying to call it directly. +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.