Skip to content

Conversation

panayotmarinov
Copy link

@panayotmarinov panayotmarinov commented Aug 20, 2025

Context

SAP/cloud-sdk-java-backlog#ISSUENUMBER.

Please provide a short description of what your change does and why it is needed.

Feature scope:

  • Task1
  • Task2
    • SubTask1

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Documentation updated
  • Release notes updated

Copy link

cla-assistant bot commented Aug 20, 2025

CLA assistant check
All committers have signed the CLA.

@panayotmarinov panayotmarinov changed the title Seamless handling of Cross-level consumption of destination-fragment pairs Transparent Proxy: Seamless handling of Cross-level consumption of destination-fragment pairs Aug 20, 2025
Copy link
Member

@MatKuhr MatKuhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also update the PR description and sign the CLA 😉

@@ -673,6 +675,34 @@ public DynamicBuilder fragmentName( @Nonnull final String fragmentName )
return header(new Header(FRAGMENT_NAME_HEADER_KEY, fragmentName));
}

/**
* Sets the destination level for the dynamic destination. See
* https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/dynamic-lookup-of-destinations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any docs here about the level?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version of the documentation with the dynamic lookup of destinations is not yet applied to the public documentation since this feature is not released in the transparent proxy yet. You can see the corresponding page in the internal documentation: https://wiki.one.int.sap/wiki/pages/viewpage.action?pageId=3811223491

However, I have used the public documentation URL since the change will be applied there with the next transparent proxy release.

* @return This builder instance for method chaining.
*/
@Nonnull
public DynamicBuilder destinationLevel( @Nonnull final String destinationLevel )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is either "subaccount" or "instance". For such cases, we usually use enums and, in fact, just introduced one: https://github.com/SAP/cloud-sdk-java/blob/main/cloudplatform/connectivity-destination-service/src/main/java/com/sap/cloud/sdk/cloudplatform/connectivity/DestinationServiceOptionsAugmenter.java#L139

But I also assume the two provider options don't apply to transparent Proxy? If it's just two options and not 4, then you could also consider to default to subaccount and just add one method without args to explicitly change it to .instanceLevel() From the test code below it looks like provider is also supported, then let's reuse the enum.

What is the behavior of TP if nothing is given? I assume subaccount?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are four possible values for both destinationLevel and fragmentLevel - "provider_subaccount", "provider_instance", "subaccount" and "instance". The behaviour of the TP if nothing is given matches that of the Destination Service - the "default level" is "instnace ".

I have applied the DestinationServiceOptionsAugmenter.CrossLevelScope enum which fits perfectly for this scenario.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "default level" is "instnace ".

for the /v2 consume API yes, for the /v1 find destination it will fallback to subaccount. So I assume TP uses /v2 under the hood?

Because the Cloud SDK behaves according to /v1 by default, and only if cross-level is enabled, it uses /v2...

Copy link
Author

@panayotmarinov panayotmarinov Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. The Transparent proxy works analogically - it uses the /v2 consume API when levels are defined in a either in a destination CR or as headers (the approach used in TP-CloudSDK integration). Otherwise the /v1 API is used by default.

@MatKuhr MatKuhr added do not merge Pull request must not be merged do not review Pull request should not be reviewed labels Sep 4, 2025
@MatKuhr MatKuhr marked this pull request as draft September 4, 2025 10:49
@MatKuhr
Copy link
Member

MatKuhr commented Sep 4, 2025

applied there with the next transparent proxy release.

Got it, I now marked this PR as draft and we can merge it once the release is available. @panayotmarinov kindly ping us when the release is ready and the PR has been finalized (merge conflicts, PR description, etc.). Thanks!

@panayotmarinov panayotmarinov marked this pull request as ready for review September 5, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Pull request must not be merged do not review Pull request should not be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants