public static void main(String[] args) {

        ApplicationConfig applicationConfig = new ApplicationConfig().setAppName("triple-server");

        int port = 50051;
        if (args.length != 0) {
            LOGGER.debug("first arg is {}", args[0]);
            port = Integer.valueOf(args[0]);
        }

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

        ServerConfig serverConfig = new ServerConfig()
            .setProtocol(RpcConstants.PROTOCOL_TYPE_TRIPLE)
            .setPort(port);

        ProviderConfig<SofaGreeterTriple.IGreeter> providerConfig = new ProviderConfig<SofaGreeterTriple.IGreeter>()
            .setApplication(applicationConfig)
            .setBootstrap(RpcConstants.PROTOCOL_TYPE_TRIPLE)
            .setInterfaceId(SofaGreeterTriple.IGreeter.class.getName())
            .setRef(new TripleGreeterImpl())
            .setServer(serverConfig)
            .setRegister(false);
        // .setRegistry(registryConfig);

        providerConfig.export();

        synchronized (TripleServerRegistryApplication.class) {
            try {
                while (true) {
                    TripleServerRegistryApplication.class.wait();
                }
            } catch (InterruptedException e) {
                LOGGER.error("Exit by Interrupted");
            }
        }

    }
@author <a href="mailto:leizhiyuan@gmail.com">leizhiyuan</a>
example/src/test/java/com/alipay/sofa/rpc/triple/TripleServerRegistryApplication.java