public TV DubboAction <T, TV>(Func <T, TV> action) where T : IDubboService { //"zookeeper", "zookeeper://192.168.10.14:2181", 2181 var client = new DubboClient(_consumerName, _dubboServer); using (var reference = new ServiceReference <T> { DubboClient = client, Registry = client.Registry, Timeout = 2 * 60 }) { return(action(reference.Get())); } }
public void TestMethod1() { var client = new DubboClient("net-consumer", "zookeeper", "zookeeper://192.168.10.14:2181", 2181); using (var reference = new ServiceReference<ShoyService>()) { reference.DubboClient = client; reference.Registry = client.Registry; reference.Timeout = 1000; var service = reference.Get(); var word = service.sayHello("shoy"); Console.WriteLine(word); var number = service.add(4, 34); Console.WriteLine(number); var user = service.getUser(); Console.WriteLine(user.getId()); Console.WriteLine(JsonHelper.ToJson(user, NamingType.CamelCase, true)); Assert.AreNotEqual(user, null); } }
public void TestMethod1() { var client = new DubboClient("net-consumer", "zookeeper", "zookeeper://192.168.10.14:2181", 2181); using (var reference = new ServiceReference <ShoyService>()) { reference.DubboClient = client; reference.Registry = client.Registry; reference.Timeout = 1000; var service = reference.Get(); var word = service.sayHello("shoy"); Console.WriteLine(word); var number = service.add(4, 34); Console.WriteLine(number); var user = service.getUser(); Console.WriteLine(user.getId()); Console.WriteLine(JsonHelper.ToJson(user, NamingType.CamelCase, true)); Assert.AreNotEqual(user, null); } }