public static void main(String[] args) {

        ApplicationConfig clientApp = new ApplicationConfig().setAppName("triple-client");

        /*   RegistryConfig registryConfig = new RegistryConfig();
           registryConfig.setProtocol("zookeeper").setAddress("127.0.0.1:2181");*/

        ConsumerConfig<SofaGreeterTriple.IGreeter> consumerConfig = new ConsumerConfig<SofaGreeterTriple.IGreeter>();
        consumerConfig.setInterfaceId(SofaGreeterTriple.IGreeter.class.getName())
            .setProtocol(RpcConstants.PROTOCOL_TYPE_TRIPLE)
            //.setRegistry(registryConfig)
            .setApplication(clientApp)
            .setDirectUrl("tri://127.0.0.1:50051")
            .setRegister(false);

        SofaGreeterTriple.IGreeter greeterBlockingStub = consumerConfig.refer();

        LOGGER.info("Triple stub bean successful: {}", greeterBlockingStub.getClass().getName());

        LOGGER.info("Will try to greet " + "world" + " ...");
        HelloRequest.DateTime dateTime = HelloRequest.DateTime.newBuilder().setDate("2018-12-28").setTime("11:13:00")
            .build();
        HelloRequest request = HelloRequest.newBuilder().setName("world").build();
        HelloReply reply = null;
        try {
            try {
                HelloRequest.DateTime reqDateTime = HelloRequest.DateTime.newBuilder(dateTime).setTime("")
                    .build();
                request = HelloRequest.newBuilder(request).setName("world").setDateTime(reqDateTime).build();
                reply = greeterBlockingStub.sayHello(request);
                LOGGER.info("Invoke Success,Greeting: {}, {}", reply.getMessage(), reply.getDateTime().getDate());
            } catch (StatusRuntimeException e) {
                LOGGER.error("RPC failed: {}", e.getStatus());
            } catch (Throwable e) {
                LOGGER.error("Unexpected RPC call breaks", e);
            }
        } catch (Exception e) {
            LOGGER.error("Unexpected RPC call breaks", e);
        }

    }
@author <a href="mailto:luanyanqiang@dibgroup.cn">Luan Yanqiang</a>
example/src/test/java/com/alipay/sofa/rpc/triple/TripleClientRegistryApplication.java