shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

dubbo plugin registryConfig can't refresh when update dubbo pluginData

Open ttttangzhen opened this issue 5 years ago • 2 comments

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

ttttangzhen avatar Apr 23 '21 06:04 ttttangzhen

thanks,I met this bug too

bird-man04 avatar Apr 23 '21 07:04 bird-man04

@ttttangzhen Thanks for reporting this issue. Welcome the PR. : )

dengliming avatar Apr 24 '21 15:04 dengliming