diff --git a/whatsmars-dubbo/whatsmars-dubbo-consumer-boot/src/main/java/org/hongxi/whatsmars/dubbo/demo/consumer/config/DubboConfig.java b/whatsmars-dubbo/whatsmars-dubbo-consumer-boot/src/main/java/org/hongxi/whatsmars/dubbo/demo/consumer/config/DubboConfig.java index 7bb4f16a6a48aca7bbb8f9442170d93f4a405c07..1c334fa6d3afc2fc8e44f93614c06ef3a0a8ccc6 100644 --- a/whatsmars-dubbo/whatsmars-dubbo-consumer-boot/src/main/java/org/hongxi/whatsmars/dubbo/demo/consumer/config/DubboConfig.java +++ b/whatsmars-dubbo/whatsmars-dubbo-consumer-boot/src/main/java/org/hongxi/whatsmars/dubbo/demo/consumer/config/DubboConfig.java @@ -15,9 +15,11 @@ public class DubboConfig { * 配置文件里配置默认的,这里配置其他需要的 */ @Bean("otherRegistry") - public RegistryConfig otherRegistry(@Value("${registry.other.address}") String address, - @Value("${registry.other.id}") String id) { + public RegistryConfig otherRegistry(@Value("${registry.other.protocol}") String protocol, + @Value("${registry.other.address}") String address, + @Value("${registry.other.id}") String id) { RegistryConfig registry = new RegistryConfig(); + registry.setProtocol(protocol); registry.setAddress(address); registry.setId(id); return registry; diff --git a/whatsmars-dubbo/whatsmars-dubbo-consumer-boot/src/main/resources/application.yml b/whatsmars-dubbo/whatsmars-dubbo-consumer-boot/src/main/resources/application.yml index de6c8720b45a9be26db20ab1ba873156e1d667f5..44d31e93a601b161832a17628ed1d12050377c80 100644 --- a/whatsmars-dubbo/whatsmars-dubbo-consumer-boot/src/main/resources/application.yml +++ b/whatsmars-dubbo/whatsmars-dubbo-consumer-boot/src/main/resources/application.yml @@ -4,7 +4,8 @@ spring: dubbo: registry: - address: zookeeper://127.0.0.1:2181 + protocol: zookeeper + address: 127.0.0.1:2181 id: my-registry protocol: port: 20882 @@ -18,5 +19,6 @@ dubbo: registry: other: - address: zookeeper://127.0.0.1:2181 + protocol: zookeeper + address: 127.0.0.1:2181 id: other diff --git a/whatsmars-dubbo/whatsmars-dubbo-provider-boot/src/main/java/org/hongxi/whatsmars/dubbo/demo/provider/ProviderApplication.java b/whatsmars-dubbo/whatsmars-dubbo-provider-boot/src/main/java/org/hongxi/whatsmars/dubbo/demo/provider/ProviderApplication.java index a8b119128925c88f94b03d748374457773e4d079..e8994e0cbd7c155fb06cb52d987227aaab441de5 100644 --- a/whatsmars-dubbo/whatsmars-dubbo-provider-boot/src/main/java/org/hongxi/whatsmars/dubbo/demo/provider/ProviderApplication.java +++ b/whatsmars-dubbo/whatsmars-dubbo-provider-boot/src/main/java/org/hongxi/whatsmars/dubbo/demo/provider/ProviderApplication.java @@ -12,6 +12,5 @@ import org.springframework.context.annotation.ComponentScan; public class ProviderApplication { public static void main(String[] args) throws Exception { SpringApplication.run(ProviderApplication.class, args); -// System.in.read(); } } diff --git a/whatsmars-dubbo/whatsmars-dubbo-provider-boot/src/main/java/org/hongxi/whatsmars/dubbo/demo/provider/config/DubboConfig.java b/whatsmars-dubbo/whatsmars-dubbo-provider-boot/src/main/java/org/hongxi/whatsmars/dubbo/demo/provider/config/DubboConfig.java index 360cc808021ac2f5a3de06be4017e9054879c400..948bde083761849f3f6bd24bf412d101e79692f6 100644 --- a/whatsmars-dubbo/whatsmars-dubbo-provider-boot/src/main/java/org/hongxi/whatsmars/dubbo/demo/provider/config/DubboConfig.java +++ b/whatsmars-dubbo/whatsmars-dubbo-provider-boot/src/main/java/org/hongxi/whatsmars/dubbo/demo/provider/config/DubboConfig.java @@ -15,9 +15,11 @@ public class DubboConfig { * 配置文件里配置默认的,这里配置其他需要的 */ @Bean("otherRegistry") - public RegistryConfig otherRegistry(@Value("${registry.other.address}") String address, - @Value("${registry.other.id}") String id) { + public RegistryConfig otherRegistry(@Value("${registry.other.protocol}") String protocol, + @Value("${registry.other.address}") String address, + @Value("${registry.other.id}") String id) { RegistryConfig registry = new RegistryConfig(); + registry.setProtocol(protocol); registry.setAddress(address); registry.setId(id); return registry; diff --git a/whatsmars-dubbo/whatsmars-dubbo-provider-boot/src/main/resources/application.yml b/whatsmars-dubbo/whatsmars-dubbo-provider-boot/src/main/resources/application.yml index 1619d72545d96a52e53ae242ce7f53b89201893c..d1d61c6deb476e0bcb39e5b5224d035607f27b4e 100644 --- a/whatsmars-dubbo/whatsmars-dubbo-provider-boot/src/main/resources/application.yml +++ b/whatsmars-dubbo/whatsmars-dubbo-provider-boot/src/main/resources/application.yml @@ -4,7 +4,8 @@ spring: dubbo: registry: - address: zookeeper://127.0.0.1:2181 + protocol: zookeeper + address: 127.0.0.1:2181 id: my-registry protocol: port: 20882 @@ -29,5 +30,6 @@ management: registry: other: - address: zookeeper://127.0.0.1:2181 + protocol: zookeeper + address: 127.0.0.1:2181 id: other