public static void main()

in 3-extensions/serialization/dubbo-samples-protobuf-json/protobuf-json-serialization-demo/src/main/java/org/apache/dubbo/sample/protobuf/consumer/ConsumerStarter.java [30:43]


    public static void main(String[] args) {
        ReferenceConfig<GoogleProtobufService> reference = new ReferenceConfig<>();
        ApplicationConfig applicationConfig = new ApplicationConfig("first-dubbo-consumer");
        applicationConfig.setQosEnable(false);
        reference.setApplication(applicationConfig);
        reference.setRegistry(new RegistryConfig("zookeeper://" + zookeeperHost + ":2181"));
        reference.setInterface(GoogleProtobufService.class);
        GoogleProtobufService service = reference.get();
        GoogleProtobufBasic.GooglePBRequestType requestType = GoogleProtobufBasic.GooglePBRequestType.newBuilder()
                .setString("some string from client")
                .build();
        GoogleProtobufBasic.GooglePBResponseType responseType = service.callGoogleProtobuf(requestType);
        System.out.println(responseType.getString());
    }