# 多缓存数据源starter **Repository Path**: kuqidegit/dynamic-redis-starter ## Basic Information - **Project Name**: 多缓存数据源starter - **Description**: 用于多缓存情况下项目开发 - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-04-19 - **Last Updated**: 2024-07-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 1.多缓存使用 1.这里主要体现多数据源redis的使用方式。 配置文件 spring: redis: timeout: 10s host: 192.168.65.211 lettuce: pool: max-active: 8 max-idle: 8 max-wait: -1ms min-idle: 0 password: '123456plate' port: 6379 datasource: # 第一个数据源 source1: timeout: 10s host: 192.168.65.211 port: 6379 password: 123456plate database: 3 2.pom文件添加 com.dynamic dynamic-redis-starter 2.1.1 3.代码中使用 @EnableRedisMultiDataSource//入口引入 public class TestModelApplication { public static void main(String[] args) { SpringApplication.run(TestModelApplication.class, args); } @Autowired @Qualifier("source1RedisTemplate") private RedisTemplate redisTemplate;