on 07-16-2019 7:24 AM
Hi,
I have 2 MTA applications ( in the same org and space ) - one hosting a number of API/ODATA services and another hosting a number of UI5 apps.
Within the UI5 apps I want to define model destinations which reference the API services from the other MTA.
Hence I followed the principle of 'Cross-MTA Dependency' using 'Resource Type “mta-provided”' as explained in the SAP help.
Now in essence this works fine but I am having an issue to pass along the 'url' of the service into the destination.
As per normal destination definition - a url needs to be provided:
So I am guessing that the URL parameter is not 'transferred' between the MTA's as I am getting the error during deployment:
Failed to resolve reference for provided property: 22058223-a79f-45aa-8407-5304bfeb2989-ta8xo1ynf0zp1qba-<xxxx>#services-api#url
If I include the API services within the same MTA then this works fine.
If I 'hard-code' the urls in the consumer mta.yaml then my applications work fine as well.
I have the following definitions in the mta.yaml files:
Provider
modules:
- name: bc-services-core-api
type: nodejs
path: services_api
provides:
- name: bc-services-api
public: true
properties:
url: '${default-url}'
Consumer
modules:
- name: app
type: html5
path: app
requires:
- name: bc-services-api
group: destinations
properties:
name: services-api
url: '~{url}'
forwardAuthToken: true
resources:
- name: bc-services-api
type: mta-provided
parameters:
mta-id: BC_<XXXX>
mta-provides-dependency: bc-services-api
mta-version: '>=0.0.1'
In the SAP help there is small topic about properties which talks about 'cross-reference' of properties and putting a 'requires' under the resources ... but whatever I try I am not able to save the MTA.YAML file then ...
Anyone any suggestions on how to resolve this ? Or am I missing or declared something wrong in the yaml file ?
Also note I am trying this currently out on an HANA Express SPS3 system ( latest patches ) but this needs to run in the cloudfoundry platform eventually ( hopefully there are no differences ).
Thanks,
Steven
Hi Sven,
Your code snippets seem to be properly modeled for the task. Have you double-checked if the 'mta-provided' parameter values are correct? This can be easily done, as at least on cf, when deploying the provider MTA in the progress messages similar rows are printed:
> Publishing publicly provided dependency "<mta-id>:<dependency name>"...
The <mta-id> value and <dependency name> value should be used for the mta-id and mta-provides-dependency parameters of the mta-provided resource.
By the way, there is another way to consume such cross-mta provided configurations - via a 'configuration' resource, which has certain benefits over 'mta-provided'. Below should be a working modelling for your case. Once you get this tested, remember to add additional filters to the configuration resources (e.g. org/space of dependency origin) to prevent side effects in production - e.g. of deployments of other mtas in different spaces .
resources:
- name: bc-services-api
type: configuration
parameters:
provider-nid: mta
provider-id: <your-mta-ID>:bc-services-api
modules:
- name: app
...
requires:
- name: bc-services-api
properties:
url: '~{url}'
Please reply if the resolution is still failing.
Dimitar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Dimitar ... works like a charm - well at least in the cloud.
Didn't try it yet on HANA XSA - what I did notice there though is that by doing 'xs mtas' that my MTA was not listed there .... bit weird but maybe as I directly choose the 'run option' it is not actually registering as being 'deployed' ?
User | Count |
---|---|
65 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.