Failed to invoke the method subscribe in the service com.alibaba.dubbo.registry.RegistryService

本文主要是介绍Failed to invoke the method subscribe in the service com.alibaba.dubbo.registry.RegistryService,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1 异常信息

今天在写 dubbo 文章的时候遇到一个问题,倒是折腾了几分钟,百思不得其解,最后终于发现了。异常信息如下:

com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method subscribe in the service com.alibaba.dubbo.registry.RegistryService. Tried 3 times of the providers [localhost:2181, localhost:2182, localhost:2183] (3/3) from the registry localhost:2182 on the consumer 192.168.234.1 using the dubbo version 2.6.6. Last error is: Invoke remote method timeout. method: subscribe, provider: dubbo://localhost:2181/com.alibaba.dubbo.registry.RegistryService?application=provider&backup=localhost:2183,localhost:2181&callbacks=10000&check=false&connect.timeout=10000&dubbo=2.0.2&interface=com.alibaba.dubbo.registry.RegistryService&lazy=true&methods=lookup,subscribe,unsubscribe,unregister,register&owner=sihai&pid=2872&qos.accept.foreign.ip=false&qos.enable=true&qos.port=55555&reconnect=false&remote.timestamp=1564280535444&sticky=true&subscribe.1.callback=true&timeout=10000&timestamp=1564280535444&unsubscribe.1.callback=false, cause: Waiting server-side response timeout by scan timer. start time: 2019-07-28 10:22:38.380, end time: 2019-07-28 10:22:48.401, client elapsed: 9 ms, server elapsed: 10011 ms, timeout: 10000 ms, request: Request [id=2, version=2.0.2, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=subscribe, parameterTypes=[class com.alibaba.dubbo.common.URL, interface com.alibaba.dubbo.registry.NotifyListener], arguments=[consumer://192.168.234.1/com.alibaba.dubbo.registry.RegistryService?application=provider&backup=localhost:2183,localhost:2181&callbacks=10000&connect.timeout=10000&dubbo=2.0.2&interface=com.alibaba.dubbo.registry.RegistryService&lazy=true&methods=lookup,subscribe,unsubscribe,unregister,register&owner=sihai&pid=2872&qos.accept.foreign.ip=false&qos.enable=true&qos.port=55555&reconnect=false&sticky=true&subscribe.1.callback=true&timeout=10000&timestamp=1564280535444&unsubscribe.1.callback=false, com.alibaba.dubbo.registry.integration.RegistryDirectory@353352b6], attachments={path=com.alibaba.dubbo.registry.RegistryService, sys_callback_arg-1=892555958, interface=com.alibaba.dubbo.registry.RegistryService, version=0.0.0, timeout=10000}]], channel: 192.168.234.1:0 -> localhost/127.0.0.1:2181at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:102)at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:244)at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:75)at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52)at com.alibaba.dubbo.common.bytecode.proxy0.subscribe(proxy0.java)at com.alibaba.dubbo.registry.dubbo.DubboRegistry.doSubscribe(DubboRegistry.java:151)at com.alibaba.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:196)

其中,可以发现最重要异常信息就是:

com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method subscribe in the service com.alibaba.dubbo.registry.RegistryService

如果你了解 dubbo 的架构的话,其实你很快就能发现,这就是注册中心的问题。后来排查发现,确实是注册中心出了问题。

2 解决问题

知道是注册中心出现了问题,刚刚开始以为是我设置了只订阅的模式,但是,检查配置发现,并不是这种模式出现了问题。

后来,再仔细看了一下之前的配置发现,是我没有指明注册中心是哪个?(以前用的是zookeeper)。

所以,到这里就很简单了,在下面的代码中指明注册中心即可。

<dubbo:registry timeout="10000" address="localhost:2182,localhost:2183,localhost:2181"></dubbo:registry>

改为

<dubbo:registry protocol="zookeeper" timeout="10000" address="localhost:2182,localhost:2183,localhost:2181"></dubbo:registry>

这样问题就解决了。

这篇关于Failed to invoke the method subscribe in the service com.alibaba.dubbo.registry.RegistryService的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/495762

相关文章

模版方法模式template method

学习笔记,原文链接 https://refactoringguru.cn/design-patterns/template-method 超类中定义了一个算法的框架, 允许子类在不修改结构的情况下重写算法的特定步骤。 上层接口有默认实现的方法和子类需要自己实现的方法

消除安卓SDK更新时的“https://dl-ssl.google.com refused”异常的方法

消除安卓SDK更新时的“https://dl-ssl.google.com refused”异常的方法   消除安卓SDK更新时的“https://dl-ssl.google.com refused”异常的方法 [转载]原地址:http://blog.csdn.net/x605940745/article/details/17911115 消除SDK更新时的“

SOMEIP_ETS_095: SD_Check_subscribe_eventgroup_ttl_expired

测试目的: 验证DUT(Device Under Test)能够检测到测试器(Tester)的订阅已过期(ttl = 3秒),并且在TTL过期后不响应测试器触发的事件。 描述 本测试用例旨在确保DUT能够识别测试器的订阅已过期,并在订阅过期后不响应测试器通过TriggerEventUint8方法触发的事件。 测试拓扑: 具体步骤: TESTER:发送订阅事件组消息,用于事件组0x0

android java.io.IOException: open failed: ENOENT (No such file or directory)-api23+权限受权

问题描述 在安卓上,清单明明已经受权了读写文件权限,但偏偏就是创建不了目录和文件 调用mkdirs()总是返回false. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.READ_E

UserWarning: mkl-service package failed to import

安装完成anaconda,并设置了两个环境变量  之后再控制台运行python环境,输入import numpy as np,提示错误 D:\InstallFolder\Anaconda3\lib\site-packages\numpy\__init__.py:143: UserWarning: mkl-service package failed to import, therefore

Python安装llama库出错“metadata-generation-failed”

Python安装llama库出错“metadata-generation-failed” 1. 安装llama库时出错2. 定位问题1. 去官网下载llama包 2.修改配置文件2.1 解压文件2.2 修改配置文件 3. 本地安装文件 1. 安装llama库时出错 2. 定位问题 根据查到的资料,发现时llama包中的execfile函数已经被下线了,需要我们手动修改代码后

Dubbo学习入门

本文参考自:Dubbo用户手册(中文)http://dubbo.apache.org/books/dubbo-user-book/ 现在的参考文档地址:http://dubbo.apache.org/zh-cn/docs/user/quick-start.html 入门请参考自《Dubbo用户手册(中文)》第一节,在手册第二节说明如何快速启动Dubbo,下面就顺着手册的使用方式,自己搭建一个快

com.google.gson.JsonSyntaxException:java.lang.IllegalStateException异常

用Gson解析json数据的时候,遇到一个异常,如下图: 这个异常很简单,就是你的封装json数据的javabean没有写对,你仔细查看一下javabean就可以了 比如:我的解析的代码是             Gson gson = new Gson();             ForgetJson rb = gson.fromJson(agResult.mstrJson, For

探索Invoke:Python自动化任务的瑞士军刀

文章目录 探索Invoke:Python自动化任务的瑞士军刀背景:为何选择Invoke?`invoke`是什么?如何安装`invoke`?简单的`invoke`库函数使用方法场景应用:`invoke`在实际项目中的使用场景一:自动化测试场景二:代码格式化场景三:部署应用 常见问题与解决方案问题一:命令执行失败问题二:权限不足问题三:并发执行问题 总结 探索Invoke:P

The import com.google cannot be resolved

The import com.google cannot be resolved,报错: 第一感觉就是缺少jar包,因为项目用maven管理,所以在pom.xml中添加: <dependency>  <groupId>com.google.code.gson</groupId>  <artifactId>gson</artifactId>  <version>2.3.1</ver