Search in sources :

Example 1 with HelloServiceImpl

use of com.alipay.sofa.rpc.quickstart.HelloServiceImpl in project sofa-rpc by sofastack.

the class SofaRegistryServer method main.

public static void main(String[] args) {
    /**
     * 运行时项目引入依赖
     *         <dependency>
     *             <groupId>com.alipay.sofa</groupId>
     *             <artifactId>registry-client-all</artifactId>
     *             <version>5.2.0</version>
     *         </dependency>
     */
    RegistryConfig registryConfig = new RegistryConfig().setProtocol(RpcConstants.REGISTRY_PROTOCOL_SOFA).setAddress("127.0.0.1:9603");
    ServerConfig serverConfig = new ServerConfig().setProtocol("bolt").setPort(12200).setDaemon(false);
    ProviderConfig<HelloService> providerConfig = new ProviderConfig<HelloService>().setRegistry(registryConfig).setInterfaceId(HelloService.class.getName()).setRef(new HelloServiceImpl()).setServer(serverConfig);
    providerConfig.export();
    LOGGER.warn("started at pid {}", RpcRuntimeContext.PID);
}
Also used : RegistryConfig(com.alipay.sofa.rpc.config.RegistryConfig) ServerConfig(com.alipay.sofa.rpc.config.ServerConfig) ProviderConfig(com.alipay.sofa.rpc.config.ProviderConfig) HelloService(com.alipay.sofa.rpc.quickstart.HelloService) HelloServiceImpl(com.alipay.sofa.rpc.quickstart.HelloServiceImpl)

Aggregations

ProviderConfig (com.alipay.sofa.rpc.config.ProviderConfig)1 RegistryConfig (com.alipay.sofa.rpc.config.RegistryConfig)1 ServerConfig (com.alipay.sofa.rpc.config.ServerConfig)1 HelloService (com.alipay.sofa.rpc.quickstart.HelloService)1 HelloServiceImpl (com.alipay.sofa.rpc.quickstart.HelloServiceImpl)1