2.5 RegistryConfig 注册中心配置

代码示例:

RegistryConfig registry = new RegistryConfig();
// <host:port> 注册中心服务器地址
registry.setAddress("redis://*.*.*.*:6380");
// 注册中心地址协议,支持dubbo, http, local三种协议,分别表示:dubbo地址、http地址、本地注册中心
registry.setProtocol("dubbo");
// 注册中心请求超时时间(毫秒)
registry.setTimeout(5000);
// 服务注册分组,跨组的服务不会相互影响,也无法相互调用,适用于环境隔离。
registry.setGroup("1.0");

猜你喜欢

转载自blog.csdn.net/z13730736890/article/details/89403939
2.5
今日推荐