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/24 07:15:42 UTC

[GitHub] [dubbo] zxrneu opened a new issue, #11010: How to set the number of connections?

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

   
   **### Question:reference.setConnections(10);//设置未生效**
   <img width="941" alt="image" src="https://user-images.githubusercontent.com/42803787/203700154-ece52c62-c20b-4827-8937-edcd433e54d0.png">
   
   **There is only one connection. How do you make multiple connections**?
   
   
   server
   ```
   public class EchoServer {
       public static void main(String[] args) throws IOException {
           ServiceConfig<EchoService> service = new ServiceConfig<>();
           service.setInterface(EchoService.class);
           service.setRef(new EchoImpl());
   
           DubboBootstrap bootstrap = DubboBootstrap.getInstance();
           bootstrap.application(new ApplicationConfig("tri-stub-server"))
   //               .registry(new RegistryConfig("multicast://127.0.0.1:2181"))
                   .protocol(new ProtocolConfig(CommonConstants.TRIPLE, 3002))
                   .service(service)
                   .start();
           System.out.println("Dubbo triple stub server started");
           System.in.read();
       }
   }
   ```
   
   
   client 
   
   ```
   public class EchoClient {
       public static void main(String[] args) throws IOException {
           for (int i = 0; i < 3; i++) {
               new Thread(()->{
                   DubboBootstrap bootstrap = DubboBootstrap.newInstance();
                   System.out.println(bootstrap);
                   ReferenceConfig<EchoService> ref = new ReferenceConfig<>();
                   ref.setInterface(EchoService.class);
                   ref.setProtocol(CommonConstants.TRIPLE);
                   ref.setProxy(CommonConstants.NATIVE_STUB);
                   ref.setTimeout(3000);
                   ref.setUrl("tri://127.0.0.1:3002");
                   ref.setConnections(10);//设置未生效
                   bootstrap.application(new ApplicationConfig("tri-stub-client"))
                           .reference(ref)
                           .start();
   
                   EchoService echoService = ref.get();
   //                Scanner sc = new Scanner(System.in);
                   while (true){
   //                    String input = sc.next();
                       EchoRequest request = EchoRequest.newBuilder().setMessage("input").build();
                       EchoResponse echoResponse = echoService.echo(request);
                       System.out.println("Received reply:" + echoResponse.getMessage());
                   }
               }).start();
           }
           System.in.read();
   
       }
   }
   ```
   
   
   


-- 
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 #11010: How to set the number of connections?

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

   > dubbo 下的grpc协议是不是也不支持多连接?
   
   Yep


-- 
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] AlbumenJ commented on issue #11010: How to set the number of connections?

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

   @EarthChen PTAL


-- 
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] zxrneu commented on issue #11010: How to set the number of connections?

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

   dubbo 下的grpc协议是不是也不支持多连接?


-- 
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] EarthChen commented on issue #11010: How to set the number of connections?

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

   triple protocol does not currently implement multiple connections, or connection pool. Why do you help us implement it?


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