点击蓝字关注这个神奇的公众号~
![640?wx_fmt=gif](https://img-blog.csdnimg.cn/img_convert/3bd6969d10cf3da227f42f69cc768dab.gif)
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/b2d0e54f81cc8c77a63e1920953324e9.png)
Apache ServiceComb | 精选
Apache ServiceComb 致力于帮助企业、用户和开发者将企业应用轻松微服务化上云,并实现对微服务应用的高效运维管理。
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/364a5258f0b2010e7d7acade8bdaab2d.png)
ServiceComb 进展动态
ServiceComb社区已批准发布版本:
Apache ServiceComb Java-Chassis 1.1.0
Apache ServiceComb Service-Center 1.1.0
Apache ServiceComb Saga 0.2.1
详情请参考Release Notes:
https://github.com/apache/servicecomb-java-chassis/releases/tag/1.1.0
https://github.com/apache/servicecomb-service-center/releases/tag/1.1.0
https://github.com/apache/servicecomb-pack/releases/tag/0.2.1
servicecomb-Saga重命名为servicecomb-pack
为了在Pack架构中更好地支持TCC和Saga 分布式事务实现,ServiceComb-Saga更名为ServiceComb-Pack
更名后的项目地址为:
https://github.com/apache/servicecomb-pack
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/b2d0e54f81cc8c77a63e1920953324e9.png)
FAQ精选问答
Q1
谁有ServiceComb的傻瓜教程?
推荐从ServiceComb官网着手,一些资料供参考:
1.入门:
http://servicecomb.apache.org/cn/docs/quick-start/
2.step by step实现CRM系统教程:
https://github.com/huaweicse/ServiceComb-CRM-WorkShop/wiki
A
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/078bce568b23a85d6533d511a105c653.png)
Q2
启动ServiceComb-java-chassis项目sample/codefirst-sample目录里的 CodeFirstProviderMain例子程序怎么启动不起来?
报错:
Caused by:
java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getMethodsWithAnnotation(Ljava/lang/Class;Ljava/lang/Class;ZZ)[Ljava/lang/reflect/Method;
...
用户本地工程的lang3包没有更新到ServiceComb配套的版本。
解决方法: 1.在用户本地工程的pom.xml点击鼠标右键,选择执行 maven -> reimport
2.在用户本地工程的pom.xml点击鼠标右键,选择执行 maven -> Show effective pom,确认其中的lang3是:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.6</version>
</dependency>
A
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/03b74216594d019d43651503516d4775.png)
Q3
在 ServiceComb-CRM-WorkShop 例子中 边缘服务afterReceiveRequest方法 在调用String userName = template.getForObject("cse://"+USER_SERVICE_NAME + "/validate?token={token}", String.class, token) 时候,第一次调用正常后边调用会出现阻塞线程问题
报错:
Thread
Thread[transport-vert.x-eventloop-thread-4,5,main] has been blocked for 5433 ms, time limit is 2000
ServiceComb的Edge Service默认工作于高性能的reactive模式,此模式要求工作于Edge Service转发流程中的业务代码不能有任何的阻塞操作。该问题是由于用户业务模型无法满足reactive要求,因此,可以通过修改微服务的配置文件,使用ServiceComb提供的同步线程池模式解决,使用指南可以参考:
https://docs.servicecomb.io/java-chassis/zh_CN/edge/by-servicecomb-sdk.html
A
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/078bce568b23a85d6533d511a105c653.png)
Q4
Servicecomb 中的同步 restful 需要特殊配置吗?
除edge service之外,ServiceComb的restful默认都是同步的,不需要特殊配置。
A
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/03b74216594d019d43651503516d4775.png)
Q5
spring mvc项目中实现的filter,切换到微服务后,全部不起作用了,是不支持springmvc里边的filter了吗?
用户工程同时添加了springboot和provider-springmvc的依赖:
<dependency>
<groupId>org.apache.servicecomb</groupId>
<artifactId>spring-boot-starter-provider</artifactId>
</dependency>
<!-- springmvc支持 -->
<dependency>
<groupId>org.apache.servicecomb</groupId>
<artifactId>provider-springmvc</artifactId>
</dependency>
问题原因是因为SpringMVC和ServiceComb REST是两套不同架构,用户将基于SpringMVC的项目切换到ServiceComb后,还需要基于ServiceComb REST规则对老的filter做微调,ServiceComb提供相关的架构迁移案例,详情可以参考:
1.不同框架之间迁移改造可能工作量的评估指南:
https://bbs.huaweicloud.com/blogs/ba7b62178cb811e89fc57ca23e93a89f 可以参考下
2.在Spring Boot中使用ServiceComb:
https://huaweicse.github.io/cse-java-chassis-doc/using-cse-in-spring-boot/using-cse-in-spring-boot.html
A
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/078bce568b23a85d6533d511a105c653.png)
Q6
ServiceComb是否提供观察微服务业务线程池的情况功能?
通过ServiceComb内置的metrics实时监控功能,可以观察到业务线程池的情况,配置即使用,参考文档:
https://docs.servicecomb.io/java-chassis/zh_CN/general-development/metrics.html
A
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/03b74216594d019d43651503516d4775.png)
Q7
ServiceComb默认的业务线程池的大小配置是否可以通过配置文件修改?
可以,在microservice.yaml中设置:
servicecomb:
.... executor:
default:
group: 4
thread-per-group: 4executor.default:
通过这个修改默认池
A
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/078bce568b23a85d6533d511a105c653.png)
Q8
看起来ServiceComba的Saga不是基于消息实现的?ServiceComb-Saga是不是指代同步的补偿?好像跟一般观念不占用发起方事务时间的基于消息实现异步SAGA不太一样?
Saga可以有多种实现方式,当前ServiceComb-Saga是基于服务调用的,不是事件通知的方式。
A
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/03b74216594d019d43651503516d4775.png)
Q9
Servicecomb对原来spring体系的如AOP,异常处理,事务管理等都支持吧?
ServiceComb 的分布式事务是支持Spring的Transactional标注的。一般的AOP操作是不会切换线程的。
A
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/078bce568b23a85d6533d511a105c653.png)
Q10
saga我下载master版本proto无法生成
org.apache.servicecomb.saga.pack.contract.grpc.TxEventServiceGrpc.TxEventServiceImplBase这个类是什么原因?
您可以使用IDEA“maven - >生成源和更新文件夹”来生成源。
A
欢迎大家在ServiceComb讨论群
或者gitter聊天室与我们互动
https://gitter.im/ServiceCombUsers/Lobby
活动回顾
![640?wx_fmt=gif](https://img-blog.csdnimg.cn/img_convert/64ca253c8d0f3327d6f6f9a0f2a56ca6.gif)
2018/11.17
上海光大会展中心大酒店
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/3bd4569d311f07097ed17102e596edc2.png)
拥抱ServiceMesh:传统微服务框架的技术演进之路
主讲人:巨震
CNUTCon2018 全球运维技术大会
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/0562cc89ddd816ed76780723667e4afd.png)
微服务直播
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/9bc0df7ef7ad514757f725d1a0617c80.png)
2018/11.29
Netty和Vert.x在Apache顶级项目ServiceComb中的应用
主讲人:Netty专家 Mr.李
华为软件总工程师 Mr.吴
2018/.12.09
南京国际博览会议中心
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/3bd4569d311f07097ed17102e596edc2.png)
ServiceComb:开源微服务框架的技术演进之路
主讲人:巨震
IAS2018 第二届全国互联网架构峰会
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/db9fc8f54da77d11e98082f1104781cc.png)
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/8f9b6a471c0f08dca00091a8b1016aaa.png)
活动预告
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/2bff8203d924ab80be1e2b44760fdf96.png)
![640?wx_fmt=gif](https://img-blog.csdnimg.cn/img_convert/64ca253c8d0f3327d6f6f9a0f2a56ca6.gif)
第八届中国云计算标准和应用大会
![640?wx_fmt=jpeg](https://img-blog.csdnimg.cn/img_convert/3bd928fb026cce7febb5c31ab9a2d88d.png)
2018.12.12
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/3bd4569d311f07097ed17102e596edc2.png)
北京丽亭华苑酒店
主题:ServiceComb 简化上云,使命必达
主讲人:马彬
时间:16:00-16:30
另插播一条:12月11日上午 ServiceComb团队将在深圳圣淘沙酒店(翡翠店)翡翠三厅A召开的《工业互联网产业联盟工作第九次全会开源特设组会议》上向工业互联网联盟介绍Apache ServiceComb,主讲《面向工业互联网的开源框架和关键技术ServiceComb》议题。
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/0a28985c15c7b1b1b82438c10792b638.png)
长按以上二维码,加入ServiceComb讨论群
欢迎大家共同打造
我们的微服务圈
![640?wx_fmt=png](https://img-blog.csdnimg.cn/img_convert/364a5258f0b2010e7d7acade8bdaab2d.png)
![640?wx_fmt=gif](https://img-blog.csdnimg.cn/img_convert/a5a9e94e6b5ea4598d18ff869d419d03.gif)
点击“阅读原文”,观看微服务直播精彩回放