You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/06 13:10:31 UTC

[GitHub] [dubbo] pioneerjxf opened a new issue, #10884: 同时使用rest和dubbo协议时,nacos服务列表中只注册了一个协议的端口

pioneerjxf opened a new issue, #10884:
URL: https://github.com/apache/dubbo/issues/10884

   ### Environment
   
   * Dubbo version: 2.7.15
   * Operating System version: macos/centos
   * Java version: 8
   * nacos:2.03
   
   ### Steps to reproduce this issue
   
   1. dubbo协议配置如下
   `
   dubbo.application.name = dubbo-provider-demo
   dubbo.registry.protocol = nacos
   dubbo.registry.address = nacos://host:port/?encode=UTF-8&username=xxxx&password=xxxx
   
   dubbo.protocols.p1.id=dubbo-one
   dubbo.protocols.p1.name=dubbo
   dubbo.protocols.p1.port=20887
   dubbo.protocols.p1.host=0.0.0.0
   dubbo.protocols.p1.server=netty4
   
   dubbo.protocols.p2.id=rest-two
   dubbo.protocols.p2.name=rest
   dubbo.protocols.p2.port=8087
   dubbo.protocols.p2.host=0.0.0.0
   dubbo.protocols.p2.server=tomcat
   
   demo.service.version=1.0.0
   demo.service.name = demoServic`
   
   3. demoService的实现如下
   `
   @DubboService(version = "${demo.service.version}" ,protocol = {"p1","p2"})
   @Path("demo")
   public class DefaultService implements DemoService {
   
       @Value("${demo.service.name}")
       private String serviceName;
       @GET  // get请求
       @Path("say") // 路径
       @Produces({ContentType.APPLICATION_JSON_UTF_8, ContentType.TEXT_XML_UTF_8})
       public String sayName(@QueryParam("name")String name) {
           RpcContext rpcContext = RpcContext.getContext();
           return String.format("Service [name :%s , port : %d] %s(\"%s\") : Hello,%s",
                   serviceName,
                   rpcContext.getLocalPort(),
                   rpcContext.getMethodName(),
                   name,
                   name);
       }
   }
   `
   4. 使用spring启动dubbo
   `
   @EnableDubbo(scanBasePackages = "com.alibaba.dubbo.demo.service")
   @PropertySource(value = "classpath:/provider-config.properties")
   public class DemoServiceProviderBootstrap {
   
       public static void main(String[] args) throws IOException {
           AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
           context.register(DemoServiceProviderBootstrap.class);
           context.refresh();
           System.out.println("DemoService provider is starting...");
           System.in.read();
       }
   }
   `
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Behavior
   
   期望nacos的服务列表中有20887和8087两个协议的端口被注册
   
   ### Actual Behavior
   如果使用nacos 2.0.3,每次在服务列表只能注册到其中一个协议的端口,每次是@DubboService中的protocol中后面那个能注册上
   <img width="1254" alt="image" src="https://user-images.githubusercontent.com/2825478/200172327-f3f5a23d-8ec1-45c0-8980-8cc23aa9e090.png">
   
   如果使用nacos 1.2.1,每次能注册上rest和dubbo两个协议对应的端口
   <img width="1248" alt="image" src="https://user-images.githubusercontent.com/2825478/200172210-f6eaaab6-5cb1-49fd-8b54-0736de51c136.png">
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10884: 同时使用rest和dubbo协议时,nacos服务列表中只注册了一个协议的端口

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10884:
URL: https://github.com/apache/dubbo/issues/10884#issuecomment-1305270289

   Related with https://github.com/alibaba/nacos/issues/5863


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] chickenlj commented on issue #10884: 同时使用rest和dubbo协议时,nacos服务列表中只注册了一个协议的端口

Posted by GitBox <gi...@apache.org>.
chickenlj commented on issue #10884:
URL: https://github.com/apache/dubbo/issues/10884#issuecomment-1311171906

   Will be tracked with https://github.com/apache/dubbo/issues/10888


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] chickenlj closed issue #10884: 同时使用rest和dubbo协议时,nacos服务列表中只注册了一个协议的端口

Posted by GitBox <gi...@apache.org>.
chickenlj closed issue #10884: 同时使用rest和dubbo协议时,nacos服务列表中只注册了一个协议的端口
URL: https://github.com/apache/dubbo/issues/10884


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org