* Polish /apache/dubbo#5745 : Increasing the stack size in the start.sh * Polish /apache/dubbo#5297 : Only one of the multiple registration centers using nacos can register
This commit is contained in:
parent
f4af3ded4b
commit
eda947a8df
|
|
@ -213,7 +213,7 @@ public class RegistryConfig extends AbstractConfig {
|
|||
URL url = URL.valueOf(address);
|
||||
setUsername(url.getUsername());
|
||||
setPassword(url.getPassword());
|
||||
updateIdIfAbsent(url.getProtocol());
|
||||
// updateIdIfAbsent(url.getProtocol());
|
||||
updateProtocolIfAbsent(url.getProtocol());
|
||||
updatePortIfAbsent(url.getPort());
|
||||
updateParameters(url.getParameters());
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcess
|
|||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||
import org.springframework.context.annotation.CommonAnnotationBeanPostProcessor;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.PriorityOrdered;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.beans.PropertyDescriptor;
|
||||
|
|
@ -43,7 +44,7 @@ import static org.springframework.util.ReflectionUtils.invokeMethod;
|
|||
* @since 2.7.6
|
||||
*/
|
||||
public class DubboConfigDefaultPropertyValueBeanPostProcessor extends GenericBeanPostProcessorAdapter<AbstractConfig>
|
||||
implements MergedBeanDefinitionPostProcessor, Ordered {
|
||||
implements MergedBeanDefinitionPostProcessor, PriorityOrdered {
|
||||
|
||||
/**
|
||||
* The bean name of {@link DubboConfigDefaultPropertyValueBeanPostProcessor}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class EnableDubboConfigTest {
|
|||
Assertions.assertEquals("netty", consumerConfig.getClient());
|
||||
|
||||
// asserts aliases
|
||||
assertTrue(hasAlias(context, "org.apache.dubbo.config.RegistryConfig#0", "zookeeper"));
|
||||
assertFalse(hasAlias(context, "org.apache.dubbo.config.RegistryConfig#0", "zookeeper"));
|
||||
assertFalse(hasAlias(context, "org.apache.dubbo.config.MonitorConfig#0", "zookeeper"));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public abstract class AbstractRegistryFactory implements RegistryFactory {
|
|||
.addParameter(INTERFACE_KEY, RegistryService.class.getName())
|
||||
.removeParameters(EXPORT_KEY, REFER_KEY)
|
||||
.build();
|
||||
String key = url.toServiceStringWithoutResolving();
|
||||
String key = createRegistryCacheKey(url);
|
||||
// Lock the registry access process to ensure a single instance of the registry
|
||||
LOCK.lock();
|
||||
try {
|
||||
|
|
@ -130,6 +130,17 @@ public abstract class AbstractRegistryFactory implements RegistryFactory {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the key for the registries cache.
|
||||
* This method may be override by the sub-class.
|
||||
*
|
||||
* @param url the registration {@link URL url}
|
||||
* @return non-null
|
||||
*/
|
||||
protected String createRegistryCacheKey(URL url) {
|
||||
return url.toServiceStringWithoutResolving();
|
||||
}
|
||||
|
||||
protected abstract Registry createRegistry(URL url);
|
||||
|
||||
|
||||
|
|
@ -175,7 +186,7 @@ public abstract class AbstractRegistryFactory implements RegistryFactory {
|
|||
}
|
||||
};
|
||||
|
||||
public static void removeDestroyedRegistry(Registry toRm){
|
||||
public static void removeDestroyedRegistry(Registry toRm) {
|
||||
LOCK.lock();
|
||||
try {
|
||||
REGISTRIES.entrySet().removeIf(entry -> entry.getValue().equals(toRm));
|
||||
|
|
|
|||
|
|
@ -30,6 +30,11 @@ import static org.apache.dubbo.registry.nacos.util.NacosNamingServiceUtils.creat
|
|||
*/
|
||||
public class NacosRegistryFactory extends AbstractRegistryFactory {
|
||||
|
||||
@Override
|
||||
protected String createRegistryCacheKey(URL url) {
|
||||
return url.toFullString();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Registry createRegistry(URL url) {
|
||||
return new NacosRegistry(url, createNamingService(url));
|
||||
|
|
|
|||
Loading…
Reference in New Issue