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)
- 修改dubbo.application.name metaService 旧的记录还在 HOT 1
- [Bug] An error occurred when adding the extension dubco-metadata-report-etcd HOT 4
- [Bug] triple远程调用,连接异常重连,导致客户端阻塞直到超时 HOT 1
- [Bug] Build failed after relying on version 3.2.11 or later HOT 4
- [Bug] docker dubbo cluster broadcast not working HOT 1
- [Bug] Non-idempotent unit tests (follow-up of #14134)
- [Bug] In the example dubco-samples-spring-boot-trace-skywalking, the run fails HOT 2
- No provider available from registry RegistryDirectory(registry: 127.0.0.1:8848) HOT 1
- Dubbo 3.2 throws an error directly upon startup HOT 4
- [Bug] override url with configurator from "service-name.configurators" in interface mode not as expected HOT 10
- The matching wildcard is strict, but no declaration can be found for element 'dubbo:consumer'. HOT 1
- [Bug] enable-empty-protection default value is different between doc and code HOT 2
- [Bug] [Serialization Security] Serialized class java.lang.ArithmeticException is not in allow list. HOT 3
- [Bug] dubbo Provider列表变更通知consumer 消费端 出现NullPointerException bug HOT 1
- [Bug] java.lang.IllegalArgumentException: interface org.apache.dubbo.rpc.service.EchoService is not visible from class loader HOT 1
- [Bug] The registry uses etcd, but javaagent skywalking fails to start HOT 6
- [Bug] there are problems if mapping key only has service interface class name
- [Bug] level too large 2048 problem during serialization data by fastjson2 HOT 1
- No such extension org.apache.dubbo.rpc.Filter
- [Bug] HOT 1
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.