Package com.alibaba.dubbo.remoting.exchange

Examples of com.alibaba.dubbo.remoting.exchange.ExchangeChannel.request()


      StringBuilder sb = new StringBuilder();
      for(int j=0;j<i*100;j++)
        sb.append("("+random.nextLong()+")");
      Main.Data d = new Main.Data();
      d.setData(sb.toString());
      client.request(d).get();
    }
    System.out.println("send finished.");
  }

  static void mutliThreadTest(int tc,final int port) throws Exception
View Full Code Here


  }

  private static void test(int port) throws Exception
  {
      ExchangeChannel client = Exchangers.connect(URL.valueOf("dubbo://localhost:" + port));
    MockResult result = (MockResult)client.request(new RpcMessage(DemoService.class.getName(),"plus",new Class<?>[]{int.class, int.class},new Object[]{55,25})).get();
    System.out.println("55+25="+result.getResult());

    for(int i=0;i<100;i++)
      client.request(new RpcMessage(DemoService.class.getName(),"sayHello", new Class<?>[]{String.class},new Object[]{"qianlei"+i}));
View Full Code Here

      ExchangeChannel client = Exchangers.connect(URL.valueOf("dubbo://localhost:" + port));
    MockResult result = (MockResult)client.request(new RpcMessage(DemoService.class.getName(),"plus",new Class<?>[]{int.class, int.class},new Object[]{55,25})).get();
    System.out.println("55+25="+result.getResult());

    for(int i=0;i<100;i++)
      client.request(new RpcMessage(DemoService.class.getName(),"sayHello", new Class<?>[]{String.class},new Object[]{"qianlei"+i}));

    for(int i=0;i<100;i++)
      client.request(new Main.Data());

    System.out.println("=====test invoke=====");
View Full Code Here

    for(int i=0;i<100;i++)
      client.request(new RpcMessage(DemoService.class.getName(),"sayHello", new Class<?>[]{String.class},new Object[]{"qianlei"+i}));

    for(int i=0;i<100;i++)
      client.request(new Main.Data());

    System.out.println("=====test invoke=====");
    for(int i=0;i<100;i++){
      ResponseFuture future = client.request(new Main.Data());
      System.out.println("invoke and get");
View Full Code Here

    for(int i=0;i<100;i++)
      client.request(new Main.Data());

    System.out.println("=====test invoke=====");
    for(int i=0;i<100;i++){
      ResponseFuture future = client.request(new Main.Data());
      System.out.println("invoke and get");
      System.out.println("invoke result:" + future.get());
    }
    System.out.println("=====the end=====");
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.