dubbo问题

1、spring boot注解问题

EnableDubbo 在主方法上添加此注解
Reference获取暴露服务 此包com.alibaba.dubbo.config.annotation.Reference下边的
Service dubbo提供的暴露服务,此包com.alibaba.dubbo.config.annotation.Service下边的
上边三个注解过期,替换方法如下

// 2.7.x 之前,Alibaba时期
com.alibaba.dubbo.config.annotation.Reference
com.alibaba.dubbo.config.annotation.Service

// 2.7.0之后,Apache时期
org.apache.dubbo.config.annotation.Reference
org.apache.dubbo.config.annotation.Service

// 2.7.7之后
org.apache.dubbo.config.annotation.DubboReference
org.apache.dubbo.config.annotation.DubboService

2、dubbo创建问题,引入zookpeer

<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>2.12.0</version>
</dependency>

<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>2.12.0</version>
</dependency>

 3、dubbo覆盖策略(优先级从上到下)

-D java启动参数

xml配置

properties

4、各个参数

timeout请求超时时间 check启动时检查服务 loadbalance:random(随机) roundRobin(轮询) leastActive(最小活跃调用数) consistentHash(一致性hash)

5、配置覆盖

方法级优先 接口次之 全局再次之

消费者优先 提供者次之

 

posted on 2022-03-01 16:35  ttke  阅读(246)  评论(0编辑  收藏  举报