Springboot + Spring data same entity in multiple databases

user3495816 :

I have a table "config" in multiple databases (for countries "uk", "pl", ...) and I want to load this table for each DB with Springboot and Spring data. So at the start of application I want to load config tables from each database in to one collection.

I looked into using AbstractRoutingDatasource but I feel like it is no ideal.

What approach would you recommend?

Thilina Sampath :

I use below example for my code there are one DB declare as primary. link or link2 there second one is easy to understand.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=103733&siteId=1