cancel
Showing results for 
Search instead for 
Did you mean: 

MTA Deployment Deletes Route Mappings

bmcdonn2
Participant

Hello Everyone,

I've noticed that when deploying an MTAR file, the mappings of any non-default routings defined in the CF environment associated with an application are deleted. The route definition itself remains but the mapping is purged. Is this the expected behavior and is there any way to prevent this loss of mappings?

The context I'm working with is for a multi-tenant approuter where routings are created/mapped as part of the tenant onboarding process. This dynamic nature of the mappings means that I cannot simply define the routes within an mta/manifest.yml file.

I suppose it would be possible to create some initialization logic to read onboarded tenants from my persistent store and re-map the routes on app restart but I'm hoping I can avoid that by just having the mapped routes remain after app re-deploys.

Any guidance on this question is appreciated.

Thanks,

Brian

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Could you please clarify this statement: "I cannot simply define the routes within an mta/manifest.yml file"?

bmcdonn2
Participant
0 Kudos

Ivan,

I am working in a multi-tenant context where I cannot assume that I will know all routes that need to be defined for each tenant. Even if I did know all of my tenants, that is not a detail I would want to encode within a manifest.yml or mta.yaml* file. Instead of defining routes statically in these files they are added/removed programatically during tenant onboarding/offboarding. This works fine until I need to redploy the app where said mappings are destroyed. As I alluded to in my original message, I could technically write more logic to run on app start-up to read a list of tenants from my persistent store and re-map the routes but that would require developing additional logic that I'm hoping I can avoid.

*for the record, I'm not even sure routes can be defined in the mta.yaml file. If you have an example of this it could prove to be useful in other applications outside of this specific question

Thanks,

Brian

bmcdonn2
Participant
0 Kudos

I guess I should also clarify that the routings I'm discussing are those that are defined within the CF environment. The type you would see with a cf routes command in the CF CLI.

This is not about routes defined within an approuter module in the xs-app.json file.

Accepted Solutions (1)

Accepted Solutions (1)

lucasvaccaro
Product and Topic Expert
Product and Topic Expert

Hi Brian,

By default, the MTA deployer service deletes mappings that are not defined in the descriptor file. You can use the "keep-existing-routes: true" in the yml file to change this behavior. You can place it either at the top of the document (for all modules), or you can add it to each module. Find the definition in MTA Module Types, Resource Types, and Parameters for Applications in the Cloud Foundry Environment

Best Regards,
Lucas

---------------------

P.S.: Now also a KBA is available thanks to Lucas
https://launchpad.support.sap.com/#/notes/2762799
Ervin(moderator)

Answers (0)