# smart-config **Repository Path**: aizuda/smart-config ## Basic Information - **Project Name**: smart-config - **Description**: 基于redis实现的轻量级的配置中心,基于字段级的配置 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-06-06 - **Last Updated**: 2025-06-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 项目的来源 很多小的项目或者公司,都需要相关的配置中心,但是使用nacos或者apollo,又比较重或者繁琐。所以就想基于redis实现一个轻量级的配置中心。 # 基于redis的配置中心 基于redis的sub和pub模式实现轻量级配置中心,支持配置自动更新。 同时有定时任务,定时拉取配置redis中的配置,并更新到配置,避免因为消息丢失导致配置不更新。默认每隔3秒拉取一次。 ## 使用说明 ### jdk 17+ ### 引入依赖: com.smart.retry smart-config-core ${smart.config.version} ### 配置文件: ```yaml smart: config: app-name: smart-config-admin --应用名称 enabled: true --是否开启配置中心 pull-interval: 3 --拉取间隔时间 spring: data: redis: host: localhost port: 6379 password: lettuce: pool: max-active: 10 max-wait: 100 max-idle: 8 min-idle: 0 shutdown-timeout: 100 ``` ### 页面 ![img.png](img.png) ![img_1.png](img_1.png) ### 风险点 使用pub/sub模式,当类型不配置时,会导消息解析失败,字段值还是原来的值。 持续优化中...,欢迎提出建议,共同打造更好的配置中心。 后续会引入持久化存储,支持配置版本管理,配置灰度发布、权限控制等功能。