Giter Site home page Giter Site logo

Comments (9)

liuyangc3 avatar liuyangc3 commented on May 19, 2024

同样遇到了这个问题,等待高人解答

from dubbo.

gunsnakee avatar gunsnakee commented on May 19, 2024

本地存根可以用,mock本地伪装用不了。

from dubbo.

leoshus avatar leoshus commented on May 19, 2024

遇到同样的问题v2.5.3 有解决的吗

from dubbo.

bbiao avatar bbiao commented on May 19, 2024

2.5.3还是有这个问题

from dubbo.

wuzhefang avatar wuzhefang commented on May 19, 2024

是不是重启一下服务端,刷新一下服务列表就好了?

from dubbo.

JKAK47 avatar JKAK47 commented on May 19, 2024

dubbo的本地伪装有谁成功实现过。按照dubbo官方文档设置。然后关于服务提供方服务。服务调用方调用接口也是会失败的。

from dubbo.

JKAK47 avatar JKAK47 commented on May 19, 2024

2.5.3 还是有这个不能本地伪装的问题存在

from dubbo.

kitikousei avatar kitikousei commented on May 19, 2024

在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.

diecui1202 avatar diecui1202 commented on May 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.