Comments (9)
同样遇到了这个问题,等待高人解答
from dubbo.
本地存根可以用,mock本地伪装用不了。
from dubbo.
遇到同样的问题v2.5.3 有解决的吗
from dubbo.
2.5.3还是有这个问题
from dubbo.
是不是重启一下服务端,刷新一下服务列表就好了?
from dubbo.
dubbo的本地伪装有谁成功实现过。按照dubbo官方文档设置。然后关于服务提供方服务。服务调用方调用接口也是会失败的。
from dubbo.
2.5.3 还是有这个不能本地伪装的问题存在
from dubbo.
在AbstractRegistry中有一段这样的代码
for (Map.Entry<String, List> entry : result.entrySet()) {
String category = entry.getKey();
List categoryList = entry.getValue();
categoryNotified.put(category, categoryList);
saveProperties(url);
listener.notify(categoryList);
}
这里的result内容如下
[providers=[empty://192.168.1.137/com.xxx.xxService?application=myconsume&category=providers&default.check=false&default.mock=true&dubbo=2.5.5&interface=com.xxx.xxService&methods=register&pid=27046side=consumer], configurators=[empty://192.168.1.137/com.xxx.xxService?application=myconsume&category=configurators&default.check=false&default.mock=true&dubbo=2.5.5&interface=com.xxx.xxService&methods=register&pid=27046&side=consumer], routers=[empty://192.168.1.137/com.xxx.xxService?application=myconsume&category=routers&default.check=false&default.mock=true&dubbo=2.5.5&interface=com.xxx.xxService&methods=register&pid=27046&side=consumer]]
在jdk1.7中第一次循环取的是providers。后面的逻辑会去刷新forbidden字段(refreshInvoker方法)。此时是forbidden设置为true,第二次循环会设置为false,第三次会设置成false。此时可以本地伪装。
但是在jdk1.8中第一次循环去的是configurators。后面的逻辑会去刷新forbidden字段(refreshInvoker方法)。此时是forbidden设置为false,第二次循环会设置为true,第三次会设置成true。此时就本地伪装就没法调用
from dubbo.
Local stub works only when providers >= 1. Local mock's bug has fixed, please check https://github.com/apache/incubator-dubbo/blob/fd7bab3cdf2650168e9eca625fd5311ffc7b1f5a/dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java#L142
Feel free to reopen it or open a new issue if you have any other questions.
from dubbo.
Related Issues (20)
- Consumer和Provider为同一服务时,seata的xid丢失问题 HOT 4
- [Feature] Document Defects Difficult to Get Started HOT 7
- [Bug] dubbo-2.7.22的优雅停机存一个bug HOT 1
- [Bug] Graceful Shutdown in dubbo-2.7.22 Has a Bug HOT 6
- [Bug] Error when passing java.util.RandomAccessSubList parameter HOT 1
- [Feature][Dubbo-python] Implement the basic functions of an RPC framework. HOT 1
- [Bug] grpc-status is missing HOT 1
- [Bug] Compile native, not support generic invoke HOT 2
- [Bug] When using the RedisMetadataReport, the subscription fails when the producer is not started and there is no metadata. As a result, after the subsequent producer is started, the consumer cannot find the metadata information corresponding to the producer and report an error. HOT 6
- [Feature] Add more test coverage for org.apache.dubbo.rpc.protocol.dubbo.pu
- [Feature] Remove invalid parameters <org.apache.dubbo.rpc.protocol.tri.stream> HOT 1
- [Feature] dubbo uses setSecurityManager which is now deprecated on JDK 17 HOT 2
- [Bug] Rest request can not handle custom header's value correctly
- protocol线程池参数配置无效 HOT 4
- [Bug] RpcException with no provider avaliable messages will be thrown if the newly dubbo reference is immediately called. HOT 1
- [Bug] Dubbo 3.3-beta6 NoClassDefFoundError: com/google/protobuf/ProtocolMessageEnum HOT 1
- [Bug] Using a higher version of fury in dubbo-serialization-fury will result in an error 'Fail to decode request due to RpcInvocation'. Currently, it is known that fury versions 0.4.1 and above will experience this issue HOT 4
- [Feature] rest protocol connection default keepalive
- [Bug] When I use @DubboReference to make a call it starts with an error log, but it doesn't affect the use of the HOT 1
- [Bug] When I use @DubboReference to make a call it starts with an error log, but it doesn't affect the use of the
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dubbo.