【ServiceComb】

基于华为内部CSE开源

子项目

项目简介

开源URL

业界主流

chassis

微服务开发框架

https://github.com/apache/servicecomb-java-chassis

Spring Cloud、Dubbo

Service Center

注册中心

https://github.com/apache/servicecomb-service-center

Eureka、Consul、Nacos、Zookeeper、Etcd

Kie

配置中心

https://github.com/apache/servicecomb-kie

Apollo、Nacos、Spring Cloud Config、Zookeeper、Etcd

Edge

网关

 

Zuul、Spring Cloud Gateway、Kong、Nginx、Envoy

Pack

分布式事务

https://github.com/apache/servicecomb-pack

https://github.com/apache/servicecomb-saga-actuator

Seata、TX-LCN

Mesher

服务网格

https://github.com/apache/servicecomb-Mesher

Istio

Fence

认证鉴权

https://github.com/apache/servicecomb-fence

spring-security、Shiro

启动过程分为初始化 Log4j、bean 加载(包括配置加载)和服务注册三部分

  • 初始化 Log4j:默认会从 classpath*:config/base/log4j.properties 和classpath*:config/log4j.properties 两个路径读取 log4j 配置并合并,将其传递给 Log4j 的PropertyConfigurator 方法初始化 Log4j。
  • bean 加载:BeanUtils 默认会从 classpath*:META-INF/spring/*.bean.xml 路径加载配置文件,并将其传递给 Spring 框架的 ClassPathXmlApplicationContext 完成应用上下文加载。在这个过程中会加载foundation-config 模块的 bean,完成配置加载。
  • 服务注册:在 Spring context 加载完成后, io.servicecomb.core.CseApplicationListener (继承自Spring ApplicationListener)会加载 handler,配置、加载 provider 的 schema 信息,最后将微服务信息注册到服务中心。

         CseApplicationListener.onApplicationEvent -> 全局listener、manager注册 -> SCBEngine.init ->SCBEngine.doInit stage多阶段执行

    

在此过程中还通过Google EventBus来实现消息的pub/sub,如afterRegistryInstance监听注册完毕的消息来做初始化状态刷新

 

关键实现:Handler

 

posted @ 2022-12-18 13:31  飞翔在天  阅读(117)  评论(0编辑  收藏  举报