[重磅更新] 升级 dubbo 3.0 使用原生 starter 整合 减少与 feign 的无用兼容配置

This commit is contained in:
疯狂的狮子Li
2022-03-08 02:13:09 +08:00
parent 16a349708b
commit c31d52d8b4
8 changed files with 22 additions and 12 deletions

View File

@@ -22,8 +22,8 @@
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-dubbo</artifactId>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
<dependency>

View File

@@ -30,12 +30,12 @@ public class SaTokenDubboConsumerFilter implements Filter {
// 追加 Id-Token 参数
if(SaManager.getConfig().getCheckIdToken()) {
RpcContext.getContext().setAttachment(SaIdUtil.ID_TOKEN, SaIdUtil.getToken());
RpcContext.getServiceContext().setAttachment(SaIdUtil.ID_TOKEN, SaIdUtil.getToken());
}
// 1. 调用前向下传递会话Token
if(SaManager.getSaTokenContextOrSecond() != SaTokenContextDefaultImpl.defaultContext) {
RpcContext.getContext().setAttachment(SaTokenConsts.JUST_CREATED, StpUtil.getTokenValueNotCut());
RpcContext.getServiceContext().setAttachment(SaTokenConsts.JUST_CREATED, StpUtil.getTokenValueNotCut());
}
// 2. 开始调用

View File

@@ -27,7 +27,7 @@ public class DubboRequestFilter implements Filter {
return invoker.invoke(invocation);
}
String client = CommonConstants.PROVIDER;
if (RpcContext.getContext().isConsumerSide()) {
if (RpcContext.getServiceContext().isConsumerSide()) {
client = CommonConstants.CONSUMER;
}
String baselog = "Client[" + client + "],InterfaceName=[" + invocation.getInvoker().getInterface().getSimpleName() + "],MethodName=[" + invocation.getMethodName() + "]";