问题
I want to migrate to Micronaut or Quarkus from Spring Boot, but in Spring boot there is one feature as AbstractRoutingDataSource, which in runtime change datasouce. Is there anything similar or any mechanism in micronaut or quarkus which gives opportunity to work with multiple datasources in runtime??
Spring-boot feature for reference https://medium.com/innomizetech/dynamic-multi-database-application-with-spring-boot-7c61a743e914
回答1:
You can define multiple data sources in properties. And write some simple wrapper that will switch active datasource depending on e.g enum. It's not exactly the same but will work the same way
来源:https://stackoverflow.com/questions/61561056/multiple-datasource-with-micronautor-or-quarkus