|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
package org.apache.dolphinscheduler.remote.rpc; |
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.remote.config.NettyServerConfig; |
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.remote.rpc.client.IRpcClient; |
|
|
|
|
import org.apache.dolphinscheduler.remote.rpc.client.RpcClient; |
|
|
|
|
import org.apache.dolphinscheduler.remote.rpc.remote.NettyServer; |
|
|
|
@ -14,6 +13,8 @@ import org.apache.dolphinscheduler.remote.utils.Host;
|
|
|
|
|
public class MainTest { |
|
|
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NettyServer nettyServer = new NettyServer(new NettyServerConfig()); |
|
|
|
|
|
|
|
|
|
// NettyClient nettyClient=new NettyClient(new NettyClientConfig());
|
|
|
|
@ -21,19 +22,15 @@ public class MainTest {
|
|
|
|
|
Host host = new Host("127.0.0.1", 12636); |
|
|
|
|
|
|
|
|
|
IRpcClient rpcClient = new RpcClient(); |
|
|
|
|
IUserService userService = rpcClient.create(UserService.class,host); |
|
|
|
|
IUserService userService = rpcClient.create(UserService.class, host); |
|
|
|
|
boolean result = userService.say("calvin"); |
|
|
|
|
System.out.println( "异步回掉成功"+result); |
|
|
|
|
System.out.println("异步回掉成功" + result); |
|
|
|
|
|
|
|
|
|
System.out.println(userService.hi(10)); |
|
|
|
|
System.out.println(userService.hi(188888888)); |
|
|
|
|
|
|
|
|
|
UserService user = rpcClient.create(UserService.class,host); |
|
|
|
|
UserService user = rpcClient.create(UserService.class, host); |
|
|
|
|
System.out.println(user.hi(99999)); |
|
|
|
|
System.out.println(user.hi(998888888)); |
|
|
|
|
// UserCallback.class.newInstance().run("lllll");
|
|
|
|
|
|
|
|
|
|
// nettyClient.sendMsg(host,rpcRequest);
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|