You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
brpc exception, serviceInterface must not be set repeatedly, please use another RpcClient #37
Caused by: com.baidu.brpc.exceptions.RpcException: serviceInterface must not be set repeatedly, please use another RpcClient
at com.baidu.brpc.protocol.standard.BaiduRpcProtocol.decodeResponse(BaiduRpcProtocol.java:162)
at com.baidu.brpc.protocol.standard.BaiduRpcProtocol.decodeResponse(BaiduRpcProtocol.java:70)
at com.baidu.brpc.client.handler.ClientWorkTask.run(ClientWorkTask.java:65)
at com.baidu.brpc.utils.ThreadPool.consume(ThreadPool.java:131)
at com.baidu.brpc.utils.ThreadPool.access$000(ThreadPool.java:37)
at com.baidu.brpc.utils.ThreadPool$1.run(ThreadPool.java:79)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Activity
xiaoquanju commentedon Apr 27, 2021
我也遇到了
xiaoquanju commentedon Apr 27, 2021
想用到产品里 遇到这个问题 有点不敢用了
day210 commentedon Nov 24, 2021
+1,有进展了吗,单条写没问题,一次多条就报错了,具体能多少也不固定,有时候能一次写10条,有时候4个就开始报这个错了。 现在一次一条太连续也不行了,得隔十几秒。
day210 commentedon Nov 27, 2021
https://github.com/AprilYoLies/raft-java 这个可以用
fwhdzh commentedon Jun 20, 2024
我发现楼主和其他人已经提了对这个问题的PR #38 #24 ,但是作者并没有进一步合并。
这个问题的关键在于ExampleServiceImpl.java的这里
这里会在每一次有用户set请求时,使用leaderRpcClient生成一个新的ExampleService实例。但是对于同一个RpcClient对象来说,多次使用BrpcProxy.getProxy生成新的Service实例是不被brpc-java允许的。
因此这里应该重写下代码,不在leaderRpcClient没有被赋值为新对象的情况下重新生成ExampleService实例。具体可以参考楼主和其他人的PR。