diff --git a/pom.xml b/pom.xml
index 56b69b425..baf790dc1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
4.0.0
manage
- 1.0.40
+ 1.1.0
UTF-8
diff --git a/src/main/java/au/com/royalpay/payment/manage/pos/datasource/DataSourceConfiguration.java b/src/main/java/au/com/royalpay/payment/manage/pos/datasource/DataSourceConfiguration.java
index f50c714a1..d5abe9fb9 100644
--- a/src/main/java/au/com/royalpay/payment/manage/pos/datasource/DataSourceConfiguration.java
+++ b/src/main/java/au/com/royalpay/payment/manage/pos/datasource/DataSourceConfiguration.java
@@ -6,9 +6,12 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
+import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.sql.DataSource;
+import java.util.HashMap;
+import java.util.Map;
/**
* 多数据源配置类
@@ -21,15 +24,29 @@ public class DataSourceConfiguration {
private Class extends DataSource> dataSourceType;
@Bean(name = "masterDataSource")
- @Primary
@ConfigurationProperties(prefix = "spring.datasource.master")
- public DataSource masterDataSource(){
+ public DataSource masterDataSource() {
return DataSourceBuilder.create().type(dataSourceType).build();
}
@Bean(name = "slaveDataSource")
@ConfigurationProperties(prefix = "spring.datasource.slave")
- public DataSource slaveDataSource1(){
+ public DataSource slaveDataSource() {
return DataSourceBuilder.create().type(dataSourceType).build();
}
+
+
+ @Bean("routingDataSource")
+ @Primary
+ public AbstractRoutingDataSource roundRobinDataSouceProxy() {
+ ReadWriteSplitRoutingDataSource proxy = new ReadWriteSplitRoutingDataSource();
+ Map