<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.8</li>
<li>Operating System version: deepin</li>
<li>Java version: 1.8.0_261</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">org.apache.dubbo.rpc.cluster.router.tag.TagRouter#route In the list of provider URLs obtained, parameters dubbo.tag The value of the tag route is the same, which causes the tag routing not to work normally</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">问题描述</h3>
<p dir="auto">使用注解开发dubbo的服务端和消费端。当服务端暴露多个协议的时候，dubbo客户端<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/reference/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/reference">@reference</a>无法指定协议去消费。但是在dubbo的消费XML配置方式是支持的</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" &lt;dubbo:reference id=&quot;userService&quot; interface=&quot;com.jiangzz.service.IUserService&quot; protocol=&quot;dubbo&quot;/&gt;"><pre class="notranslate"><code class="notranslate"> &lt;dubbo:reference id="userService" interface="com.jiangzz.service.IUserService" protocol="dubbo"/&gt;
</code></pre></div>
<p dir="auto">但是@Refernece目前没有注解支持改配置信息，希望官方有时间修正该问题！</p>
<h3 dir="auto">环境</h3>
<ul dir="auto">
<li>Dubbo version: 2.6.2</li>
<li>Operating System version: win7</li>
<li>Java version: 1.8.0_161</li>
</ul>
<h3 dir="auto">创建服务端，同时支持三种协议</h3>
<p dir="auto">服务端：</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Service(protocol = {&quot;dubbo&quot;,&quot;rmi&quot;,&quot;rest&quot;})
@Path(value = &quot;users&quot;)
public class UserService implements IUserService {
    @GET
    @Path(value = &quot;queryUserById&quot;)
    @Produces(value = {&quot;application/json;charset=utf-8&quot;})
    public User queryUser(@QueryParam(value = &quot;id&quot;) Integer id) {
        User user=new User();
        user.setId(id+&quot;&quot;);
        user.setBirthDay(new Date());
        user.setName(&quot;张三&quot;);
        return user;
    }
}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Service</span>(<span class="pl-s1">protocol</span> = {<span class="pl-s">"dubbo"</span>,<span class="pl-s">"rmi"</span>,<span class="pl-s">"rest"</span>})
<span class="pl-c1">@</span><span class="pl-c1">Path</span>(<span class="pl-s1">value</span> = <span class="pl-s">"users"</span>)
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">UserService</span> <span class="pl-k">implements</span> <span class="pl-smi">IUserService</span> {
    <span class="pl-c1">@</span><span class="pl-c1">GET</span>
    <span class="pl-c1">@</span><span class="pl-c1">Path</span>(<span class="pl-s1">value</span> = <span class="pl-s">"queryUserById"</span>)
    <span class="pl-c1">@</span><span class="pl-c1">Produces</span>(<span class="pl-s1">value</span> = {<span class="pl-s">"application/json;charset=utf-8"</span>})
    <span class="pl-k">public</span> <span class="pl-smi">User</span> <span class="pl-en">queryUser</span>(<span class="pl-c1">@</span><span class="pl-c1">QueryParam</span>(<span class="pl-s1">value</span> = <span class="pl-s">"id"</span>) <span class="pl-smi">Integer</span> <span class="pl-s1">id</span>) {
        <span class="pl-smi">User</span> <span class="pl-s1">user</span>=<span class="pl-k">new</span> <span class="pl-smi">User</span>();
        <span class="pl-s1">user</span>.<span class="pl-en">setId</span>(<span class="pl-s1">id</span>+<span class="pl-s">""</span>);
        <span class="pl-s1">user</span>.<span class="pl-en">setBirthDay</span>(<span class="pl-k">new</span> <span class="pl-smi">Date</span>());
        <span class="pl-s1">user</span>.<span class="pl-en">setName</span>(<span class="pl-s">"张三"</span>);
        <span class="pl-k">return</span> <span class="pl-s1">user</span>;
    }
}</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Configuration
@DubboComponentScan(basePackages = {&quot;com.jiangzz.service.impl&quot;})
public class DubboConfig {
    @Bean
    public ApplicationConfig applicationConfig() {
        ApplicationConfig applicationConfig = new ApplicationConfig();
        applicationConfig.setName(&quot;provider-test&quot;);
        return applicationConfig;
    }

    @Bean(&quot;dubbo&quot;)
    public ProtocolConfig protocolConfig0(){
        ProtocolConfig protocolConfig=new ProtocolConfig(&quot;dubbo&quot;);
        protocolConfig.setPort(20880);
        protocolConfig.setServer(&quot;netty4&quot;);
        return protocolConfig;
    }
    @Bean(&quot;rmi&quot;)
    public ProtocolConfig protocolConfig1(){
        ProtocolConfig protocolConfig=new ProtocolConfig(&quot;rmi&quot;);
        protocolConfig.setPort(20881);
        protocolConfig.setServer(&quot;netty4&quot;);
        return protocolConfig;
    }
    @Bean(&quot;rest&quot;)
    public ProtocolConfig protocolConfig2(){
        ProtocolConfig protocolConfig=new ProtocolConfig(&quot;rest&quot;);
        protocolConfig.setPort(8080);
        protocolConfig.setServer(&quot;netty4&quot;);
        protocolConfig.setContextpath(&quot;/services&quot;);
        protocolConfig.setServer(&quot;netty&quot;);
        return protocolConfig;
    }
    @Bean
    public RegistryConfig registryConfig() {
        RegistryConfig registryConfig = new RegistryConfig();
        registryConfig.setAddress(&quot;zookeeper://192.168.65.135:2181&quot;);
        registryConfig.setClient(&quot;curator&quot;);
        return registryConfig;
    }
}
"><pre class="notranslate"><code class="notranslate">@Configuration
@DubboComponentScan(basePackages = {"com.jiangzz.service.impl"})
public class DubboConfig {
    @Bean
    public ApplicationConfig applicationConfig() {
        ApplicationConfig applicationConfig = new ApplicationConfig();
        applicationConfig.setName("provider-test");
        return applicationConfig;
    }

    @Bean("dubbo")
    public ProtocolConfig protocolConfig0(){
        ProtocolConfig protocolConfig=new ProtocolConfig("dubbo");
        protocolConfig.setPort(20880);
        protocolConfig.setServer("netty4");
        return protocolConfig;
    }
    @Bean("rmi")
    public ProtocolConfig protocolConfig1(){
        ProtocolConfig protocolConfig=new ProtocolConfig("rmi");
        protocolConfig.setPort(20881);
        protocolConfig.setServer("netty4");
        return protocolConfig;
    }
    @Bean("rest")
    public ProtocolConfig protocolConfig2(){
        ProtocolConfig protocolConfig=new ProtocolConfig("rest");
        protocolConfig.setPort(8080);
        protocolConfig.setServer("netty4");
        protocolConfig.setContextpath("/services");
        protocolConfig.setServer("netty");
        return protocolConfig;
    }
    @Bean
    public RegistryConfig registryConfig() {
        RegistryConfig registryConfig = new RegistryConfig();
        registryConfig.setAddress("zookeeper://192.168.65.135:2181");
        registryConfig.setClient("curator");
        return registryConfig;
    }
}

</code></pre></div>
<p dir="auto"><strong>客户端：</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Configuration
@DubboComponentScan(basePackages = &quot;com.jiangzz.service&quot;)
public class DubboConfig {
    @Reference
    private IUserService userService;
   @Bean
    public IUserService userService(){
        return userService;
   }
    @Bean
    public ApplicationConfig applicationConfig() {
        ApplicationConfig applicationConfig = new ApplicationConfig();
        applicationConfig.setName(&quot;consumer-test&quot;);
        return applicationConfig;
    }
    @Bean
    public ConsumerConfig consumerConfig() {
        ConsumerConfig consumerConfig = new ConsumerConfig();
        consumerConfig.setTimeout(3000);
        consumerConfig.setClient(&quot;netty4&quot;);

        return consumerConfig;
    }
    @Bean
    public RegistryConfig registryConfig() {
        RegistryConfig registryConfig = new RegistryConfig();
        registryConfig.setAddress(&quot;zookeeper://192.168.65.135:2181&quot;);
        registryConfig.setClient(&quot;curator&quot;);
        return registryConfig;
    }
}"><pre class="notranslate"><code class="notranslate">@Configuration
@DubboComponentScan(basePackages = "com.jiangzz.service")
public class DubboConfig {
    @Reference
    private IUserService userService;
   @Bean
    public IUserService userService(){
        return userService;
   }
    @Bean
    public ApplicationConfig applicationConfig() {
        ApplicationConfig applicationConfig = new ApplicationConfig();
        applicationConfig.setName("consumer-test");
        return applicationConfig;
    }
    @Bean
    public ConsumerConfig consumerConfig() {
        ConsumerConfig consumerConfig = new ConsumerConfig();
        consumerConfig.setTimeout(3000);
        consumerConfig.setClient("netty4");

        return consumerConfig;
    }
    @Bean
    public RegistryConfig registryConfig() {
        RegistryConfig registryConfig = new RegistryConfig();
        registryConfig.setAddress("zookeeper://192.168.65.135:2181");
        registryConfig.setClient("curator");
        return registryConfig;
    }
}
</code></pre></div>
<p dir="auto">调用：</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  AnnotationConfigApplicationContext acc=new AnnotationConfigApplicationContext(DubboConfig.class);
        IUserService bean = acc.getBean(IUserService.class);
        for(int i=0;i&lt;1000;i++){
            User user = bean.queryUser(1);
            System.out.println(user);

        }"><pre class="notranslate"><code class="notranslate">  AnnotationConfigApplicationContext acc=new AnnotationConfigApplicationContext(DubboConfig.class);
        IUserService bean = acc.getBean(IUserService.class);
        for(int i=0;i&lt;1000;i++){
            User user = bean.queryUser(1);
            System.out.println(user);

        }
</code></pre></div>
<p dir="auto">###异常信息</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Exception in thread &quot;main&quot; java.lang.RuntimeException: RESTEASY004530: Could not find a method for: public abstract com.jiangzz.entities.User com.jiangzz.service.IUserService.queryUser(java.lang.Integer)
	at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:74)
	at com.sun.proxy.$Proxy31.queryUser(Unknown Source)
	at com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java)
	at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47)
	at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76)
	at com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol$2.doInvoke(AbstractProxyProtocol.java:97)
	at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:148)
	at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:54)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:48)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:77)
	at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56)
	at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:78)
	at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:238)
	at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:75)
	at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52)
	at com.alibaba.dubbo.common.bytecode.proxy0.queryUser(proxy0.java)
	at com.jiangzz.StartClientDemo.main(StartClientDemo.java:18)
"><pre class="notranslate"><code class="notranslate">Exception in thread "main" java.lang.RuntimeException: RESTEASY004530: Could not find a method for: public abstract com.jiangzz.entities.User com.jiangzz.service.IUserService.queryUser(java.lang.Integer)
	at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:74)
	at com.sun.proxy.$Proxy31.queryUser(Unknown Source)
	at com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java)
	at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47)
	at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76)
	at com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol$2.doInvoke(AbstractProxyProtocol.java:97)
	at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:148)
	at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:54)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:48)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
	at com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:77)
	at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56)
	at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:78)
	at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:238)
	at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:75)
	at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52)
	at com.alibaba.dubbo.common.bytecode.proxy0.queryUser(proxy0.java)
	at com.jiangzz.StartClientDemo.main(StartClientDemo.java:18)

</code></pre></div>