This project provides Routing Multi DataSource integrations for Spring Boot
-
Dependency Management
repositories {
maven { url 'https://jitpack.io' } (1)
}
dependencies {
compile 'com.github.aafwu00:routing-datasource-spring-boot-starter:x.y.z' (2)
}
-
add
jitpack
repository -
add dependency
-
Add the following an annotation to your Spring configuration
-
`@EnableTransactionManagement`
-
Write
application.yml
code
Name | Default | Description |
---|---|---|
datasource.routing.enabled |
false |
|
datasource.routing.type |
Whether to choose routing type( |
Name | Default | Description |
---|---|---|
datasource.routing.switchOff.* |
Switch Off DataSource. Same as |
|
datasource.routing.switchOn.* |
Switch On DataSource. Same as |
-
See on switchable-sample
Name | Default | Description |
---|---|---|
datasource.routing.master.* |
Master DataSource. Same as |
|
datasource.routing.slave.* |
Slave DataSource(readOnly = true). Same as |
-
See on switchable-sample
Name | Default | Description |
---|---|---|
datasource.routing.defaults.* |
Default DataSource. Same as |
|
datasource.routing.mapped.[key].* |
Mapping DataSource. Same as |
-
See on mapped-sample
Name | Default | Description |
---|---|---|
datasource.routing.targets.[name].* |
Multi DataSource. Same as |
|
datasource.routing.multi.[name].standalone |
Single DataSource, Use |
|
datasource.routing.multi.[name].master |
Replication DataSource, Use |
|
datasource.routing.multi.[name].slave |
Replication DataSource, Use |
|
datasource.routing.multi.[name].switchOff |
Switchable DataSource, Use |
|
datasource.routing.multi.[name].switchOn |
Switchable DataSource, Use |
|
datasource.routing.multi.[name].defaults |
Mapped DataSource, Use |
|
datasource.routing.multi.[name].mapped.[key] |
Mapped DataSource, Use |
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
-
Taeho Kim - Initial work - aafwu00
This project is licensed under the Apache License 2.0 - see the LICENSE file for details