use of com.alipay.sofa.rpc.asynchain.ServiceBImpl in project sofa-rpc by sofastack.
the class ServerB method main.
public static void main(String[] args) {
// B服务里的C服务客户端
ConsumerConfig<ServiceC> consumerConfig = new ConsumerConfig<ServiceC>().setApplication(new ApplicationConfig().setAppName("BBB")).setInterfaceId(ServiceC.class.getName()).setDirectUrl("bolt://127.0.0.1:12299?appName=CCC").setRegister(false).setInvokeType(// 不设置,调用级别可设置
"callback").setTimeout(2000);
ServiceC serviceC = consumerConfig.refer();
ServerConfig serverConfig = new ServerConfig().setPort(12298).setDaemon(false);
ProviderConfig<ServiceB> providerConfig = new ProviderConfig<ServiceB>().setInterfaceId(ServiceB.class.getName()).setApplication(new ApplicationConfig().setAppName("BBB")).setRef(new ServiceBImpl(serviceC)).setServer(serverConfig).setRegister(false);
providerConfig.export();
}
Aggregations