I am having a spring boot application. It is having rest end points which are consumed by angular application. My application is hosted on tomcat server.
- myapp1.mydomain.com -> My War File -> database schema1
- myapp2.mydomain.com -> My War File -> database schema2
- myapp3.mydomain.com -> My War File -> database schema3
In this scenario I need to create multiple war file with just different database pointing but same code base.
Is it possible to decide at run time using the host name and then point to respective database schema.
I tried @primary but in it the repository is considered at run time, that is point to database 1 or 2 and code is written. With this approach I will have to recode all my spring data repository calls.