!220 update 使用Dubbo常量替换DUBBO_IP_TO_REGISTRY硬编码

* update 使用Dubbo常量替换DUBBO_IP_TO_REGISTRY硬编码
dev
花伤情犹在 9 months ago committed by 疯狂的狮子Li
parent 7d2bc6f031
commit 7b47d01ce7

@ -1,5 +1,6 @@
package org.dromara.common.dubbo.config; package org.dromara.common.dubbo.config;
import org.apache.dubbo.common.constants.CommonConstants;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
@ -35,7 +36,7 @@ public class CustomBeanFactoryPostProcessor implements BeanFactoryPostProcessor,
*/ */
@Override @Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
String property = System.getProperty("DUBBO_IP_TO_REGISTRY"); String property = System.getProperty(CommonConstants.DubboProperty.DUBBO_IP_TO_REGISTRY);
if (StringUtils.isNotBlank(property)) { if (StringUtils.isNotBlank(property)) {
return; return;
} }
@ -59,6 +60,6 @@ public class CustomBeanFactoryPostProcessor implements BeanFactoryPostProcessor,
} }
} }
// 设置系统属性 DUBBO_IP_TO_REGISTRY 为获取到的 IP 地址 // 设置系统属性 DUBBO_IP_TO_REGISTRY 为获取到的 IP 地址
System.setProperty("DUBBO_IP_TO_REGISTRY", ip); System.setProperty(CommonConstants.DubboProperty.DUBBO_IP_TO_REGISTRY, ip);
} }
} }

Loading…
Cancel
Save