user3495816
user3495816

Reputation: 637

Springboot + Spring data same entity in multiple databases

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?

Upvotes: 3

Views: 4575

Answers (1)

Thilina Sampath
Thilina Sampath

Reputation: 3773

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

Upvotes: 2

Related Questions