开发者社区 > 云原生 > 正文

我用了Dubbo2.7.1版本,没有接入Sentinel是可以正常调用的,只要引用了Sentinel

我用了Dubbo2.7.1版本,没有接入Sentinel是可以正常调用的,只要引用了Sentinel的maven包后客户端调用就异常了。

org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-test test org.apache.dubbo dubbo-spring-boot-starter 2.7.1 org.springframework.cloud spring-cloud-starter-alibaba-sentinel 0.2.1.RELEASE org.apache.dubbo dubbo 2.7.1 org.apache.zookeeper zookeeper 3.4.14 org.apache.curator curator-framework 4.2.0 org.apache.curator curator-recipes 4.2.0 com.alibaba.csp sentinel-web-servlet 1.5.1 com.alibaba.csp sentinel-transport-simple-http 1.5.1 com.alibaba.csp sentinel-dubbo-adapter 1.5.1 com.alibaba.csp sentinel-annotation-aspectj 1.5.1 com.alibaba.csp

2019-04-19 18:26:32.416 ERROR 45480 --- [nio-8086-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service com.demo.provider.service.IMyService. Tried 3 times of the providers [10.254.115.204:20881] (1/4) from the registry 10.94.30.167:2181 on the consumer 10.254.115.204 using the dubbo version 2.7.1. Last error is: com.alibaba.dubbo.rpc.RpcContext.getContext()Lcom/alibaba/dubbo/rpc/RpcContext;] with root cause

原提问者GitHub用户cookiejoo

展开
收起
码字王 2023-05-19 18:49:37 107 0
1 条回答
写回答
取消 提交回答
  • 对于Dubbo 2.7.x,您需要使用sentinel apache Dubbo适配器,而不是sentinel Dubbo适配器。您可以参考文档:https://github.com/alibaba/Sentinel/wiki/Adapters-to-Popular-Framework#dubbo

    原回答者GitHub用户

    2023-05-19 22:44:35
    赞同 展开评论 打赏

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
阿里云容器 AHAS Sentinel 网关流控揭秘 立即下载
workshop专场-微服务专场-开发者动手实践营-微服务-使用Sentinel进行微服务流量控制 立即下载
Sentinel分布式系统下的流量防卫兵 立即下载