All Projects → yinjihuan → Smconf

yinjihuan / Smconf

简单,集中,分布式的配置管理

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Smconf

Springboot Templates
springboot和dubbo、netty的集成,redis mongodb的nosql模板, kafka rocketmq rabbit的MQ模板, solr solrcloud elasticsearch查询引擎
Stars: ✭ 100 (-16.67%)
Mutual labels:  zookeeper, mongodb, spring-boot
Easy Notes
🍋 简笔记(easy notes)打造你的轻便私人笔记。接口涉及Spring Security、OAuth2、Jwt、MongoDB,客户端采用 Vue.js 、Ant Design
Stars: ✭ 89 (-25.83%)
Mutual labels:  mongodb, spring-boot
Milkomeda
Spring extend componets which build from experience of bussiness, let developers to develop with Spring Boot as fast as possible.(基于Spring生态打造的一系列来自业务上的快速开发模块集合。)
Stars: ✭ 117 (-2.5%)
Mutual labels:  zookeeper, spring-boot
Spring Boot 2.x Examples
Spring Boot 2.x code examples
Stars: ✭ 104 (-13.33%)
Mutual labels:  mongodb, spring-boot
Eshop Soa
EShop基于Dubbo实现SOA服务化拆分,并基于RocketMQ解决了分布式事务(新版SpringBootSOASkeleton)
Stars: ✭ 65 (-45.83%)
Mutual labels:  zookeeper, spring-boot
Spring Boot Mongodb Angular Todo App
A Sample App built using Spring Boot, Angular and MongoDB
Stars: ✭ 84 (-30%)
Mutual labels:  mongodb, spring-boot
Whatsmars
Java生态研究(Spring Boot + Redis + Dubbo + RocketMQ + Elasticsearch)🔥🔥🔥🔥🔥
Stars: ✭ 1,389 (+1057.5%)
Mutual labels:  zookeeper, spring-boot
One To One Websockets Chat
Building Persistable One-to-One Chat Using Spring Boot and WebSockets
Stars: ✭ 46 (-61.67%)
Mutual labels:  mongodb, spring-boot
Webfluxtemplate
Spring Webflux template application with working Spring Security, Web-sockets, Rest, Web MVC, and Authentication with JWT.
Stars: ✭ 107 (-10.83%)
Mutual labels:  mongodb, spring-boot
Mall
mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于SpringBoot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。
Stars: ✭ 54,797 (+45564.17%)
Mutual labels:  mongodb, spring-boot
Spring Webmvc Pac4j
Security library for Spring Web MVC: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 110 (-8.33%)
Mutual labels:  mongodb, spring-boot
Zookeeper Console
A zookeeper visual web application based on SpringBoot、Curator and Bootstrap
Stars: ✭ 63 (-47.5%)
Mutual labels:  zookeeper, spring-boot
Spring Boot Extend
在springboot基础上的扩展项目,快速集成Zookeeper、Dubbo、Apollo、Mybatis多数据源
Stars: ✭ 63 (-47.5%)
Mutual labels:  mongodb, spring-boot
Spring 5 Examples
This repository is contains spring-boot 2 / spring framework 5 project examples. Using reactive programming model / paradigm and Kotlin
Stars: ✭ 87 (-27.5%)
Mutual labels:  mongodb, spring-boot
Spring Boot Fx
🎈Spring Boot, JavaFX, bootstrap3, mongoDB
Stars: ✭ 57 (-52.5%)
Mutual labels:  mongodb, spring-boot
Sample Spring Microservices Advanced
More advanced samples of spring boot and spring cloud microservices showing usage of such tools like api Swagger2 on Zuul, integraction with MongoDB, configuration server, testing with Spring Cloud Contract or Hoverfly
Stars: ✭ 112 (-6.67%)
Mutual labels:  mongodb, spring-boot
Subnode.org
SubNode: Social Media App
Stars: ✭ 25 (-79.17%)
Mutual labels:  mongodb, spring-boot
Springbootunity
rabbitmq、redis、scheduled、socket、mongodb、Swagger2、spring data jpa、Thymeleaf、freemarker etc. (muti module spring boot project) (with spring boot framework,different bussiness scence with different technology。)
Stars: ✭ 845 (+604.17%)
Mutual labels:  mongodb, spring-boot
Superman
Superman是什么:构建Java 高级开发技术的知识体系,从基础不断打怪升级成为超人之路(更新中.......)
Stars: ✭ 106 (-11.67%)
Mutual labels:  zookeeper, spring-boot
Kkbinlog
支持mysql、MongoDB数据变更订阅分发
Stars: ✭ 112 (-6.67%)
Mutual labels:  mongodb, spring-boot

Smconf专注于分布式环境下配置的统一管理

目前只支持java,其他语言如果需要支持可以使用Smconf提供的Rest API

架构图

目标

  • 提供配置的统一管理
  • 多个环境(生产环境:prod, 线上测试环境:online, 线下测试环境:test, 开发环境:dev)
  • web后台配置管理
  • 配置修改后实时同步到使用的客户端
  • 无缝集成spring和spring boot项目
  • 非spring项目中也可以使用
  • web后台支持不同账号管理不同环境的配置
  • 支持水平扩容,负载,部署多个server,client自动发现
  • 支持用户自定义配置修改回调接口做扩展
  • 支持手动触发推送配置到指定的节点
  • 修改配置可以选择推送的节点,可用于做灰度发布测试
  • 配置的历史修改记录

文档

案列

配置管理

配置列表

配置修改

配置历史记录

配置推送

作者

历史版本下载

FAQ

整合dubbox 2.8.4报错?

Caused by: java.lang.NoSuchMethodError: org.apache.curator.utils.PathUtils.validatePath(Ljava/lang/String;)Ljava/lang/String;

这个错主要是由于dubbo也带了zk的客户端,jar包冲突导致的,所以我们将dubbo旧的版本排除掉

<dependency>
	<groupId>com.alibaba</groupId>
	<artifactId>dubbo</artifactId>
	<exclusions>
		<exclusion>
			<groupId>org.apache.curator</groupId>
			<artifactId>curator-client</artifactId>
		</exclusion>
		<exclusion>
			<groupId>org.apache.curator</groupId>
			<artifactId>curator-framework</artifactId>
		</exclusion>
	</exclusions>
</dependency>

spring boot整合dubbox 2.8.4启动时需要dubbo配置信息怎么办?

由于Smconf的初始化机制是在spring bean实例化之后再对配置bean进行数据加载

spring boot中使用dubbo是用的@bean注解的初始化方式

所以在初始化dubbo的时候,这个时候Smconf的配置还没有初始化好,导致dubbo的配置不能被管理

为了解决这个问题,可以在启动spring前先将配置信息初始化z到环境变量中,这样后面dubbo就可以顺利的初始化了

只需要一行代码即可

public static void main(String[] args) {
	//启动时需要配置来做连接,需要在spring启动前将一些配置信息加载到环境变量使用
	//com.fangjia.ld.service.config是你的配置所在的包
	SmconfInit.init("com.fangjia.ld.service.config");
	//也可以使用 System.setProperty("smconf.conf.package", "com.fangjia.ld.service.config");来代替上面的init
	//也可以在application.properties中配置smconf.conf.package=com.fangjia.ld.service.config来代替上面的init

	new SpringApplicationBuilder().sources(LdApplication.class).web(false).run(args);
        try {
        	new CountDownLatch(1).await();
	} catch (InterruptedException e) {
		LOGGER.error("项目启动异常", e);
	}
}

application.properties文件中使用$符号取值

spring.dubbo.application.name=${spring.dubbo.applicationName}
spring.dubbo.registry.address=${spring.dubbo.registryAddress}
spring.dubbo.protocol.name=${spring.dubbo.protocolName}
spring.dubbo.protocol.port=${spring.dubbo.protocolPort}

/**
 * dubbo配置信息
 * @author yinjihuan
 *
 */
@CxytianDiConf(system=Constant.SYSTEM,env=true, prefix="spring.dubbo")
public class DubboConf {
	
	@ConfField("zookeeper地址")
	private String registryAddress = "zookeeper://192.168.10.47:2181";
	
	@ConfField("dubbo服务名称")
	private String applicationName = Constant.SYSTEM;
	
	@ConfField("dubbo暴露协议")
	private String protocolName = "dubbo";
	
	@ConfField("dubbo暴露端口")
	private Integer protocolPort = 20881;
}

非spring环境的java项目中怎么使用?

只需要在程序启动前加载配置即可,但是如果在非spring的环境中使用,获取配置就只能从ConfApplication中获取,不能通过@Autowired注入来使用,因为你没有spring

import org.cxytiandi.conf.client.ConfApplication;
import org.cxytiandi.conf.client.init.SmconfInit;
import org.cxytiandi.conf.demo.conf.DbConf;
/**
 * 非Spring环境中使用
 * @author yinjihuan
 *
 */
public class NoSpringEnvDemo {
	public static void main(String[] args) {
		SmconfInit.init("org.cxytiandi.conf.demo.conf");
		System.out.println(ConfApplication.getBean(DbConf.class).getMaxTime());
	}
}

不想使用配置中心的配置怎么办?

有的时候我们在开发环境下,有多个开发人员,你改改配置我改改配置,导致每个人的都不一样,开发环境下需要调试的话你可以自己在本地搭建一套Smconf

还有一种办法就是只用本地配置文件里的默认值,这样就不用去配置中心加载配置了。 只需要在application.properties中添加smconf.data.status=local即可,默认为加载远程配置 也可以通过-Dsmconf.data.status=local来设置

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].