Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dubbo 2.6.x cannot found correct method with telnet command #4611

Merged
merged 4 commits into from
Dec 20, 2019

Conversation

qixiaobo
Copy link
Contributor

Environment
Dubbo version: 2.6.6
Operating System version: *nix
Java version: 1.7
When we use complex arguments, in telnet mode , we need use jsonArray to parse.
But in our code ,someone try to resolve an overwrite problem ,so make an issue #257
then @beiwei30 try to fix this issue use this code below 27917f2

The code will make the default method not take effect.

The code before like this

 private static Method findMethod(Exporter<?> exporter, String method, List<Object> args) {
        Invoker<?> invoker = exporter.getInvoker();
        Method[] methods = invoker.getInterface().getMethods();
        Method invokeMethod = null;
        for (Method m : methods) {
            if (m.getName().equals(method) && m.getParameterTypes().length == args.size()) {
                if (invokeMethod != null) { // 重载
                    if (isMatch(invokeMethod.getParameterTypes(), args)) {
                        invokeMethod = m;
                        break;
                    }
                } else {
                    invokeMethod = m;
                }
                invoker = exporter.getInvoker();
            }
        }
        return invokeMethod;

We can have a default method with the the methodName and the same length arguments.
But after the code change , it must provides the correct arguments type. We should know
json parse cannot give the corrent type. It maybe JsonObject or even HashMap.
So someone points out this problem #2766.
In my opinion ,we should not define the same name method. Such as retry or timeout , these configs may just take effect in method or service or provider .In these cases ,methodName can stands for method. That is to say ,a lot of configs just consider the method name .
In dubbo 2.7.x, for this issue ,dubbo provides a new telnet command called select.
So ,We should consider which is better.

See issue #4565

@qixiaobo qixiaobo changed the title #4565 Dubbo 2.6.x cannot found correct method with telnet command Dubbo 2.6.x cannot found correct method with telnet command Jul 20, 2019
add license

Failed to execute goal �[32morg.apache.rat:apache-rat-plugin:0.12:check�[m �[1m(verify.rat)�[m on project �[36mdubbo-rpc-dubbo�[m: �[1;31mToo many files with unapproved license: 3 See RAT report in: /home/travis/build/apache/dubbo/dubbo-rpc/dubbo-rpc-dubbo/target/rat.txt
@chickenlj chickenlj merged commit 69cc9bd into apache:2.6.x Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants