Commit 1cf1a67b by 韩兵

add: 调整配置值

parent fac36c9e
Pipeline #75037 passed with stages
in 32 minutes 17 seconds
......@@ -63,7 +63,7 @@
<commons.lang.version>2.4</commons.lang.version>
<des.version>1.0.2-SNAPSHOT</des.version>
<mapstruct.version>1.3.1.Final</mapstruct.version>
<pandora.version>1.1.0-SNAPSHOT</pandora.version>
<!--<pandora.version>1.1.0-SNAPSHOT</pandora.version>-->
</properties>
<!-- 子模块可选依赖 -->
......@@ -191,12 +191,12 @@
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
<!--引入潘多拉-->
<dependency>
<groupId>com.netease.yanxuan</groupId>
<artifactId>pandora</artifactId>
<version>${pandora.version}</version>
</dependency>
<!--&lt;!&ndash;引入潘多拉&ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>com.netease.yanxuan</groupId>-->
<!--<artifactId>pandora</artifactId>-->
<!--<version>${pandora.version}</version>-->
<!--</dependency>-->
<!-- store-redis -->
<dependency>
......
......@@ -30,10 +30,10 @@
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>
<dependency>
<groupId>com.netease.yanxuan</groupId>
<artifactId>pandora</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>com.netease.yanxuan</groupId>-->
<!--<artifactId>pandora</artifactId>-->
<!--</dependency>-->
<!--store-redis-->
<dependency>
......
......@@ -3,11 +3,7 @@ package com.netease.mail.yanxuan.change.dal.config;
import com.alibaba.druid.filter.stat.StatFilter;
import com.alibaba.druid.pool.DruidDataSource;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.netease.yanxuan.pandora.DataSourceRefresher;
import com.netease.yanxuan.pandora.spring.annotation.EnableDataSourceRefresh;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
......@@ -23,34 +19,33 @@ import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.sql.DataSource;
import java.util.Set;
/**
* @author hzfengyuexin@corp.netease.com
*/
@Configuration
@EnableTransactionManagement
@EnableApolloConfig("db-public")
@EnableDataSourceRefresh
//@EnableApolloConfig("db-public")
//@EnableDataSourceRefresh
@MapperScan(basePackages = "com.netease.mail.yanxuan.change.dal.mapper", sqlSessionFactoryRef = "sqlSessionFactoryBean")
public class DataSourceConfiguration {
@Autowired
private DrmDBConfig drmDBConfig;
/**
* pandora热切换数据源
* */
@Bean
public DataSourceRefresher dataSourceRefresher() {
DataSourceRefresher dataSourceRefresher = new DataSourceRefresher("db-public");
Set<String> dataSource = ImmutableSet.of("db.url", "db.driverClassName", "db.username", "db.password");
dataSourceRefresher.bindDataSourceWithPropertyKey("dataSource", dataSource);
return dataSourceRefresher;
}
// /**
//// * pandora热切换数据源
//// * */
//// @Bean
//// public DataSourceRefresher dataSourceRefresher() {
//// DataSourceRefresher dataSourceRefresher = new DataSourceRefresher("db-public");
//// Set<String> dataSource = ImmutableSet.of("db.url", "db.driverClassName", "db.username", "db.password");
//// dataSourceRefresher.bindDataSourceWithPropertyKey("dataSource", dataSource);
//// return dataSourceRefresher;
//// }
/**
* merchant-order-db数据源
* 数据源
*/
@Bean(name = "dataSource")
@Primary
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment