Multiple Datasource with Micronautor or Quarkus

匆匆过客 提交于 2020-05-16 05:54:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!