in 3-extensions/protocol/dubbo-samples-triple/src/main/java/org/apache/dubbo/sample/tri/TestServers.java [41:67]
public static void main(String[] args) throws IOException, InterruptedException {
new EmbeddedZooKeeper(TriSampleConstants.ZK_PORT, false).start();
// grpc
GrpcServer server = new GrpcServer(TriSampleConstants.GRPC_SERVER_PORT);
server.initialize();
server.start();
ServiceConfig<Greeter> pbService = new ServiceConfig<>();
pbService.setInterface(Greeter.class);
GreeterImpl greeterImpl = new GreeterImpl("tri-stub");
pbService.setRef(greeterImpl);
ServiceConfig<PojoGreeter> wrapService = new ServiceConfig<>();
wrapService.setInterface(PojoGreeter.class);
wrapService.setRef(new PojoGreeterImpl());
DubboBootstrap bootstrap = DubboBootstrap.getInstance();
bootstrap.application(new ApplicationConfig("demo-provider"))
.registry(new RegistryConfig(TriSampleConstants.ZK_ADDRESS))
.protocol(new ProtocolConfig(CommonConstants.TRIPLE, TriSampleConstants.SERVER_PORT))
.service(pbService)
.service(wrapService)
.start()
.await();
}