cancel
Showing results for 
Search instead for 
Did you mean: 

how to create destinations on mufti tenancy subscriber account with java cloud sdk

robert_Wang
Discoverer
0 Kudos

Hello everyone!

I have problem creating destinations on subaccount using java cloud sdk. destination creation logic is inside MtSubscriptionService.EVENT_SUBSCRIBE, so that updating Saas Registry will trigger creation of destinations on sub_account.

the PROVIDER  has 2 SUBSCRIBERs: SUB_A, SUB_B. after deploying app on PROVIDER, next step would be updating Saas registry one by one, but here I have the problem. If I update SUB_A firstly, SUB_A can be updated successfully, and then if I update SUB_B, SUB_A is updated this time again instead of SUB_B. If I wait more then 5 mins after I updated SUB_A, then I can update SUB_B successfully. 

I suppose that occurs because of the cache, since this 5 mins cache is mentioned in the documentation.

here is the code we are using:

 

 

 

Map<String, Object> theCredentials = getServiceBinding( serviceBindingName ).getCredentials( )
OAuth2DestinationBuilder
      .forTargetUrl( theCredentials.get( "uri" ).toString() )
      .withTokenEndpoint( subscriberOauthUri.toString() )
      .withClient(
        new ClientCredentials(
          theCredentials.get( CLIENTID ).toString(),
          theCredentials.get( CLIENTSECRET ).toString( )),
        OnBehalfOf.TECHNICAL_USER_CURRENT_TENANT)
      .build();

 

 

 

client id and client secret are both from destination service on provider account. 

My understanding is that cache should not be involved since tokenEndPoint is not same for each time. thus, it should have been authorized for each request. 

It is much appreciated for any kinds of help! 

Accepted Solutions (0)

Answers (0)