question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it necessary to set the value of SPI?

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.6.2 Operating System version: win7 Java version: 1.8

Step to reproduce this issue

阅读源码发现,每个代理实现类都会去判断默认实现

public class Protocol$Adaptive implements org.apache.dubbo.rpc.Protocol
{
    public void destroy()
    {
        throw new UnsupportedOperationException(
                "method public abstract void org.apache.dubbo.rpc.Protocol.destroy() of interface org.apache.dubbo.rpc.Protocol is not adaptive method!");
    }

    public int getDefaultPort()
    {
        throw new UnsupportedOperationException(
                "method public abstract int org.apache.dubbo.rpc.Protocol.getDefaultPort() of interface org.apache.dubbo.rpc.Protocol is not adaptive method!");
    }

    public org.apache.dubbo.rpc.Invoker refer(java.lang.Class arg0, org.apache.dubbo.common.URL arg1)
        throws org.apache.dubbo.rpc.RpcException
    {
        if (arg1 == null)
            throw new IllegalArgumentException("url == null");
        org.apache.dubbo.common.URL url = arg1;
        String extName = (url.getProtocol() == null ? "dubbo" : url.getProtocol());
        if (extName == null)
            throw new IllegalStateException("Fail to get extension(org.apache.dubbo.rpc.Protocol) name from url("
                    + url.toString() + ") use keys([protocol])");
        org.apache.dubbo.rpc.Protocol extension = (org.apache.dubbo.rpc.Protocol) ExtensionLoader
                .getExtensionLoader(org.apache.dubbo.rpc.Protocol.class).getExtension(extName);
        return extension.refer(arg0, arg1);
    }

    public org.apache.dubbo.rpc.Exporter export(org.apache.dubbo.rpc.Invoker arg0)
        throws org.apache.dubbo.rpc.RpcException
    {
        if (arg0 == null)
            throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument == null");
        if (arg0.getUrl() == null)
            throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument getUrl() == null");
        org.apache.dubbo.common.URL url = arg0.getUrl();
        String extName = (url.getProtocol() == null ? "dubbo" : url.getProtocol());
        if (extName == null)
            throw new IllegalStateException("Fail to get extension(org.apache.dubbo.rpc.Protocol) name from url("
                    + url.toString() + ") use keys([protocol])");
        org.apache.dubbo.rpc.Protocol extension = (org.apache.dubbo.rpc.Protocol) ExtensionLoader
                .getExtensionLoader(org.apache.dubbo.rpc.Protocol.class).getExtension(extName);
        return extension.export(arg0);
    }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:41 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
carryxyhcommented, Aug 31, 2018

Get it. I agree with u. The code readability here needs to be improved. Maybe it will be better soon. 😃

1reaction
zonghaishangcommented, Aug 31, 2018

Understand the default SPI extension point name is “” better understanding,I feel that the current implementation is working well. Some opinions are not in favor of being modified to a required value. At least we should not modify it at present.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Schedule Performance Index (SPI): An Introduction
A schedule performance index is a ratio of earned value to planned value and shows if a project is on, behind or ahead...
Read more >
A Beginner's Guide to the Schedule Performance Index
The schedule performance index (SPI) measures how close a project is to being completed compared to the schedule. Here are some tips to...
Read more >
Schedule performance index (SPI) - Designing Buildings Wiki
The schedule performance index (SPI) is a measure of how close the project is to being completed compared to the schedule.
Read more >
Schedule Performance Index (SPI) & Cost ... - PM Study Circle
According to the PMBOK Guide, “The Schedule Performance Index (SPI) is a measure of schedule efficiency, expressed as the ratio of earned value...
Read more >
Schedule Performance Index (SPI) for PMP® Exam Prep
“The Schedule Performance Index (SPI) is a measure of schedule efficiency, expressed as the ratio of earned value to planned value.”.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found