How to modify business logic of a spring boot rest api deployed in different countries

Viewed 261

I have an application developed using spring boot rest api which should be deployed in multiple countries. Business logic and few functionalities should be enable/disable depends on country. I looked after multi tenancy solution but not sure how to modify business logic for specific country. Can anyone suggest how we can implement this?

2 Answers

You can create a property element in your application.properties for the country with environment variable , then override the value of environment variable at deployment time.

In your code you can use the property for country value to select the functionality.

You should be having a single REST API application for the multiple countries. Your REST API application should be able to read properties either from properties file, or from Database if available. In that properties file you should have specific entries for countries you want to make you application available with. Then your application will read an element from the properties file which will determine for which country the application is supposed to run. And you route your business logic accordingly.

Related