easymulti-datasource-spring-boot-starter

只需要简单的在yml中配置数据源,就可以使用动态多数据源,然后在项目中使用注解切换数据源。并且整合mybatis-plus,不再需要繁琐的配置。

License

License

Categories

Categories

Spring Boot Container Microservices Data
GroupId

GroupId

com.github.wujiuye
ArtifactId

ArtifactId

easymulti-datasource-spring-boot-starter
Last Version

Last Version

2.1.1-RELEASE
Release Date

Release Date

Type

Type

jar
Description

Description

easymulti-datasource-spring-boot-starter
只需要简单的在yml中配置数据源,就可以使用动态多数据源,然后在项目中使用注解切换数据源。并且整合mybatis-plus,不再需要繁琐的配置。
Project URL

Project URL

https://github.com/wujiuye/easymulti-datasource-spring-boot-starter
Source Code Management

Source Code Management

https://github.com/wujiuye/easymulti-datasource-spring-boot-starter

Download easymulti-datasource-spring-boot-starter

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.wujiuye/easymulti-datasource-spring-boot-starter/ -->
<dependency>
    <groupId>com.github.wujiuye</groupId>
    <artifactId>easymulti-datasource-spring-boot-starter</artifactId>
    <version>2.1.1-RELEASE</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.wujiuye/easymulti-datasource-spring-boot-starter/
implementation 'com.github.wujiuye:easymulti-datasource-spring-boot-starter:2.1.1-RELEASE'
// https://jarcasting.com/artifacts/com.github.wujiuye/easymulti-datasource-spring-boot-starter/
implementation ("com.github.wujiuye:easymulti-datasource-spring-boot-starter:2.1.1-RELEASE")
'com.github.wujiuye:easymulti-datasource-spring-boot-starter:jar:2.1.1-RELEASE'
<dependency org="com.github.wujiuye" name="easymulti-datasource-spring-boot-starter" rev="2.1.1-RELEASE">
  <artifact name="easymulti-datasource-spring-boot-starter" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.wujiuye', module='easymulti-datasource-spring-boot-starter', version='2.1.1-RELEASE')
)
libraryDependencies += "com.github.wujiuye" % "easymulti-datasource-spring-boot-starter" % "2.1.1-RELEASE"
[com.github.wujiuye/easymulti-datasource-spring-boot-starter "2.1.1-RELEASE"]

Dependencies

compile (3)

Group / Artifact Type Version
org.aspectj : aspectjweaver jar 1.9.5
com.zaxxer : HikariCP jar 3.3.1
com.baomidou : mybatis-plus-boot-starter jar 3.3.2

Project Modules

There are no modules declared in this project.

easymulti-datasource

多数据源动态切换似乎已经成了微服务的标配,做过那么多项目发现每个项目都要配一个动态数据源,都要写一个切面去实现动态切换,因此,我想将这些繁琐的配置封装为starter,拿来即用。

easymulti-datasource支持主从库模式,如果多于两个数据源,可切换为普通模式使用,普通模式支持最多十个数据源。使用非常简单,只需要简单的在yml中配置数据源,就可以使用动态多数据源,然后在项目中使用注解切换数据源,当然,也支持直接调用API切换数据源。

通知

easymulti-datasource-spring-boot-starter项目已更名为easymulti-datasource,原easymulti-datasource-spring-boot-starter组件已经更名为easymulti-datasource-mybatis。新版本增加了easymulti-datasource-r2dbc(原hotkit-r2dbc)。

模块

easymulti-datasource-mybatis

Maven central License mybatis版多数据源组件,整合了mybatis-plus,不再需要繁琐的配置;

文档

特色

  • 提供两种动态多数据源模式:主从数据源模式/非主从的多数据源模式;
  • 每个数据源独立的连接池配置,可针对每个数据源单独配置连接池;
  • 支持监听SQL,监听修改某个表的某些字段的sql,用于实现埋点事件;
  • 支持事务状态监听、注册事务监听器,用于在事务回滚/提交时再完成一些后台操作。

easymulti-datasource-r2dbc

Maven central License spring-data-r2dbc版多数据源组件,用于响应式编程; ####文档

Versions

Version
2.1.1-RELEASE
2.1.0-RELEASE
2.1.0-BETA
2.0.1-RELEASE
1.1.1-RELEASE
1.1.0-RELEASE
1.0.9x-RELEASE
1.0.8-RELEASE
1.0.7b-RELEASE
1.0.6-RELEASE
1.0.5-RELEASE
1.0.1-RELEASE
1.0.0-RELEASE