shenyu
shenyu copied to clipboard
dubbo plugin registryConfig can't refresh when update dubbo pluginData
Describe the bug
when you update dubbo plugin data, like zk register address gateway can't refresh org.dromara.soul.plugin.apache.dubbo.cache.ApplicationConfigCache#registryConfig
when call this function
org.dromara.soul.plugin.apache.dubbo.handler.ApacheDubboPluginDataHandler#handlerPlugin
if (Objects.isNull(exist) || !dubboRegisterConfig.equals(exist)) {
// If it is null, initialize it
ApplicationConfigCache.getInstance().init(dubboRegisterConfig);
ApplicationConfigCache.getInstance().invalidateAll();
}
org.dromara.soul.plugin.apache.dubbo.cache.ApplicationConfigCache#init
public void init(final DubboRegisterConfig dubboRegisterConfig) {
if (applicationConfig == null) {
applicationConfig = new ApplicationConfig("soul_proxy");
}
if (registryConfig == null) {
registryConfig = new RegistryConfig();
registryConfig.setProtocol(dubboRegisterConfig.getProtocol());
registryConfig.setId("soul_proxy");
registryConfig.setRegister(false);
registryConfig.setAddress(dubboRegisterConfig.getRegister());
Optional.ofNullable(dubboRegisterConfig.getGroup()).ifPresent(registryConfig::setGroup);
}
}
the judgement registryConfig == null will allways be false, therefore, dubbo plugin registryConfig won't refresh until restart gateway
and I will fix this
thanks,I met this bug too
@ttttangzhen Thanks for reporting this issue. Welcome the PR. : )