public static void main(String[] args) {
        new RpcClientDemoByMain();
        RequestBody req = new RequestBody(2, "hello world sync");
        try {
            String res = (String) client.invokeSync(addr, req, 3000);
            System.out.println("invoke sync result = [" + res + "]");
        } catch (RemotingException e) {
            String errMsg = "RemotingException caught in oneway!";
            logger.error(errMsg, e);
            Assert.fail(errMsg);
        } catch (InterruptedException e) {
            logger.error("interrupted!");
        }
        client.shutdown();
    }
a demo for rpc client, you can just run the main method after started rpc server of {@link RpcServerDemoByMain}

@author tsui
@version $Id: RpcClientDemoByMain.java, v 0.1 2018-04-10 10:39 tsui Exp $
src/test/java/com/alipay/remoting/demo/RpcClientDemoByMain.java