alibaba / dubbo-spring-boot-starter

Dubbo Spring Boot Starter
Apache License 2.0
2.1k stars 745 forks source link

why just support one addr for "spring.dubbo.registry" ? #50

Closed hsiangbinhua closed 6 years ago

hsiangbinhua commented 6 years ago

spring.dubbo.appname=dubbo-spring-boot-starter-provider-test spring.dubbo.registry=multicast://224.0.0.0:1111 spring.dubbo.protocol=dubbo

when set multi: spring.dubbo.registry=zookeeper://xx.17.xx.xx:2181,xx.17.xx.153:2181,xx.17.xx.154:2181 then show this:

Caused by: org.springframework.beans.factory.BeanCreationException: uploadComponent; nested exception is java.lang.NumberFormatException: For input string: "2181,xx.17.xx.153:2181,xx.17.xx.154:2181" at com.alibaba.dubbo.spring.boot.DubboConsumerAutoConfiguration$1.postProcessBeforeInitialization(DubboConsumerAutoConfiguration.java:104) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1581) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:554) ... 20 common frames omitted Caused by: java.lang.NumberFormatException: For input string: "2181,xx.17.xx.153:2181,xx.17.xx.154:2181" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Integer.parseInt(Integer.java:615) at com.alibaba.dubbo.common.URL.valueOf(URL.java:237) at com.alibaba.dubbo.common.utils.UrlUtils.parseURL(UrlUtils.java:68) at com.alibaba.dubbo.common.utils.UrlUtils.parseURLs(UrlUtils.java:137) at com.alibaba.dubbo.config.AbstractInterfaceConfig.loadRegistries(AbstractInterfaceConfig.java:190) at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:378) at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:333) at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:163) at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:59) at com.alibaba.dubbo.spring.boot.DubboConsumerAutoConfiguration$1.postProcessBeforeInitialization(DubboConsumerAutoConfiguration.java:93) ... 23 common frames omitted

xionghuiCoder commented 6 years ago

We will fix it recently.

xionghuiCoder commented 6 years ago

hi, dubbo-spring-boot-starter support multi zookeeper registry like this:

spring.dubbo.registry=zookeeper://xx.17.xx.xx:2181?backup=xx.17.xx.153:2181,xx.17.xx.154:2181

and dubbo-spring-boot-starter support ano config like this:

@Service(registry = {"zookeeper://xx.17.xx.xx:2181", "zookeeper://xx.17.xx.153:2181", "zookeeper://xx.17.xx.154:2181"})
@Reference(registry = {"zookeeper://xx.17.xx.xx:2181", "zookeeper://xx.17.xx.153:2181", "zookeeper://xx.17.xx.154:2181"})