Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dubbo cloud native #4911

Merged
merged 89 commits into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
f51b394
Polish apache/dubbo#4542 : [Enhancement] Adapt the Java standard Even…
mercyblitz Jul 11, 2019
9e58caa
Polish apache/dubbo#4541 : [Feature] Add local File System DynamicCon…
mercyblitz Jul 15, 2019
9252be1
Polish apache#4541 : Bugfix
mercyblitz Jul 15, 2019
08089b6
Polish apache/dubbo#4541 : Optimization
mercyblitz Jul 15, 2019
cdd9338
Polish apache/dubbo#4541 : Add the compatibility for PollingWatchServ…
mercyblitz Jul 16, 2019
f0408f7
Polish apache/dubbo#4541 : Add delay publish without ThreadPoolExecutor
mercyblitz Jul 16, 2019
5f354a0
Polish apache/dubbo#4541 : Refactor the extension name
mercyblitz Jul 17, 2019
8152a75
Polish apache/dubbo#4541 : Add remove ops
mercyblitz Jul 17, 2019
df1a258
Polish apache/dubbo#4541 : Add testable constructor
mercyblitz Jul 17, 2019
52c0205
Polish apache/dubbo#4541 : Add getConfigGroups method
mercyblitz Jul 17, 2019
293a70d
Polish apache/dubbo#4610 : [Refactor] Refactor the bootstrap module
mercyblitz Jul 20, 2019
3218a1f
Polish apache/dubbo#4541 : Fix the nulling URL issue
mercyblitz Jul 20, 2019
d5c78ac
Polish apache/dubbo#4622 : [Refactor] Refactor ConfigManager
mercyblitz Jul 25, 2019
1d54a1d
Polish apache/dubbo#4622 : [Refactor] Refactor ConfigManager
mercyblitz Jul 25, 2019
5071a04
Polish apache/dubbo#4622 : Support multiple configcenters
mercyblitz Jul 26, 2019
ccf614c
Polish apache/dubbo#4671 : ServiceNameMapping will not map the group,…
mercyblitz Jul 26, 2019
87e88e2
update referenceCount log (#4683)
haiyang1985 Jul 29, 2019
5d299af
Polish /apache/dubbo#4687 : Remove the duplicated test code in dubbo-…
mercyblitz Jul 29, 2019
25ec31e
#4685 修改代码if判断false问题 if (hasException == false)修改成if (!hasException…
smipo Jul 30, 2019
c3132b8
Fixed Service annotation method parameters are not in effect (#4598)
Leishunyu Jul 31, 2019
f490df8
keep demo simple, and switch to use zookeeper as registry center (#4705)
beiwei30 Jul 31, 2019
c8dbd7d
@Reference auto-wires the instance of generic interface #4594 (#4677)
CodingSinger Jul 31, 2019
65a0140
try to shorten maven output to make travis build pass (#4710)
beiwei30 Aug 1, 2019
5b38331
use CountDownLatch to check zk registry if establish connection (#4589)
tswstarplanet Aug 1, 2019
a646874
Minor change
mercyblitz Aug 1, 2019
b8e601a
Merge remote-tracking branch 'upstream/master' into dubbo-cloud-native
mercyblitz Aug 2, 2019
0644fe1
Rename the extension name of WritableMetadataService
mercyblitz Aug 5, 2019
9f405d7
Polish apache/dubbo#4759 : [Refactor] Change the signature of methods…
mercyblitz Aug 7, 2019
a344121
Merge remote-tracking branch 'upstream/master' into dubbo-cloud-native
mercyblitz Aug 7, 2019
8c7f37a
Polish apache/dubbo#3984 : Add the implementation of Page<ServiceInst…
mercyblitz Aug 7, 2019
2a88323
Code merge
mercyblitz Aug 7, 2019
240c456
Code merge
mercyblitz Aug 8, 2019
391d053
Fix the cases
mercyblitz Aug 8, 2019
3e57a0a
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 8, 2019
83fc425
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 8, 2019
a147829
Refactor ConfigManager
mercyblitz Aug 12, 2019
eea35ce
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 12, 2019
e307e98
Refactor ConfigManager
mercyblitz Aug 12, 2019
f84a33d
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 12, 2019
ad3e638
Resolve the issues on ConfigManager
mercyblitz Aug 12, 2019
19f1474
Resolve conflict
mercyblitz Aug 12, 2019
07cf7b1
Refactor and add test-cases for ConfigManager
mercyblitz Aug 13, 2019
b4bf6ba
Merge branch 'cloud-native' into dubbo-cloud-native
mercyblitz Aug 13, 2019
a7088ef
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 13, 2019
df9ff69
Merge remote-tracking branch 'origin/dubbo-cloud-native' into dubbo-c…
mercyblitz Aug 13, 2019
51d2be4
Polish apache/dubbo#4774 : [Feature] Dubbo Cloud Native - To Support …
mercyblitz Aug 13, 2019
c284dad
Polish apache/dubbo#4808 : [Feature] Add the registered/unregistered …
mercyblitz Aug 13, 2019
3d84c35
Polish apache/dubbo#4807 : [Feature] Add the callback mechanism Shutd…
mercyblitz Aug 13, 2019
21bcfaa
Polish apache/dubbo#4813 : [Feature] add Prioritized implementation f…
mercyblitz Aug 13, 2019
63a315c
Polish apache/dubbo#4815 : [Feature] Add the ServiceLoader for Dubbo'…
mercyblitz Aug 14, 2019
741321c
Polish apache/dubbo#4815 : [Feature] Add the ServiceLoader for Dubbo'…
mercyblitz Aug 14, 2019
70f9de2
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 14, 2019
16c77fc
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 14, 2019
d448ab6
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 14, 2019
1ac1ad7
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 15, 2019
f67d769
Polish apache/dubbo#4813 : [Feature] add Prioritized implementation f…
mercyblitz Aug 15, 2019
b286e1d
Polish apache/dubbo#4807 : Add sort implementation
mercyblitz Aug 15, 2019
9f6e79e
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 15, 2019
0bfda83
Refactor
mercyblitz Aug 15, 2019
b5da5da
Refactor
mercyblitz Aug 16, 2019
8a7f52b
Polish apache/dubbo#4845 : [Feature] Enhance the Event-Publishing fea…
mercyblitz Aug 16, 2019
4a43d0c
Merge branch 'cloud-native' into dubbo-cloud-native
mercyblitz Aug 16, 2019
f50eed8
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 16, 2019
c70f55b
Merge remote-tracking branch 'origin/dubbo-cloud-native' into dubbo-c…
mercyblitz Aug 16, 2019
176d56b
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 16, 2019
49de00e
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 16, 2019
147c477
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 16, 2019
3fb793a
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 16, 2019
39fca05
Polish apache/dubbo#4854 : [Feature] MetadataService supports the Dub…
mercyblitz Aug 16, 2019
1f749cf
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 16, 2019
4ef7e30
Polish apache/dubbo#4857 : [Enhancement] Sync the Metadata storage ty…
mercyblitz Aug 16, 2019
21af756
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 16, 2019
64c3425
Polish apache/dubbo#4868 : [Enhancement] Refactor ConfigChangeEvent
mercyblitz Aug 19, 2019
940452e
Polish apache/dubbo#4868 : [Enhancement] Refactor ConfigChangeEvent
mercyblitz Aug 19, 2019
f676f5e
Polish apache/dubbo#4873 : [Feature] Add a conditional EventListener …
mercyblitz Aug 19, 2019
4356c52
Polish apache/dubbo#4875 : [Feature] Refactor ServiceInstancesChanged…
mercyblitz Aug 19, 2019
839c4c1
Remove the cycle dependencies
mercyblitz Aug 21, 2019
c30545c
Remove the cycle dependencies
mercyblitz Aug 21, 2019
193a751
Merge branch 'cloud-native' into dubbo-cloud-native
mercyblitz Aug 21, 2019
5ddf7b3
Polish apache/dubbo#4903 : [Feature] Set source into the BeanDefiniti…
mercyblitz Aug 21, 2019
2992d59
Merge remote-tracking branch 'origin/dubbo-cloud-native' into dubbo-c…
mercyblitz Aug 21, 2019
5b8b3f5
Polish apache/dubbo#4902 : [Feature] Dubbo Cloud Native to Spring XML…
mercyblitz Aug 21, 2019
8d11685
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 21, 2019
024e275
Polish apache/dubbo#4713 : Initial the new module and dependencies
mercyblitz Aug 21, 2019
f3925f5
Merge remote-tracking branch 'upstream/cloud-native' into dubbo-cloud…
mercyblitz Aug 21, 2019
e819462
Polish apache/dubbo#4690 : AnnotatedBeanDefinitionRegistryUtils#regis…
mercyblitz Aug 21, 2019
46999e1
Polish apache/dubbo#4690 : AnnotatedBeanDefinitionRegistryUtils#regis…
mercyblitz Aug 21, 2019
9c46d74
Polish apache/dubbo#4690 : AnnotatedBeanDefinitionRegistryUtils#regis…
mercyblitz Aug 21, 2019
492bc64
Polish apache/dubbo#4910 : [Feature] To suppoort DubboLifecycleCompon…
mercyblitz Aug 21, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* @see SmartApplicationListener
* @since 2.7.4
*/
public class DubboLifecycleComponentsApplicationListener implements ApplicationListener {
public class DubboLifecycleComponentApplicationListener implements ApplicationListener {

private List<Lifecycle> lifecycleComponents = emptyList();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.config.spring.context.annotation;

import org.apache.dubbo.common.context.Lifecycle;
import org.apache.dubbo.config.spring.context.DubboLifecycleComponentApplicationListener;

import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

import static org.apache.dubbo.config.spring.util.AnnotatedBeanDefinitionRegistryUtils.registerBeans;

/**
* A {@link ImportBeanDefinitionRegistrar register} for the {@link Lifecycle Dubbo Lifecycle} components
*
* @since 2.7.4
*/
public class DubboLifecycleComponentRegistrar implements ImportBeanDefinitionRegistrar {

@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
registerBeans(registry, DubboLifecycleComponentApplicationListener.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/
package org.apache.dubbo.config.spring.context.annotation;

import org.apache.dubbo.config.spring.context.DubboLifecycleComponentsApplicationListener;

import org.springframework.context.Lifecycle;
import org.springframework.context.annotation.Import;

Expand All @@ -37,6 +35,6 @@
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
@Import(DubboLifecycleComponentsApplicationListener.class)
@Import(DubboLifecycleComponentRegistrar.class)
public @interface EnableDubboLifecycle {
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.apache.dubbo.config.spring.ReferenceBean;
import org.apache.dubbo.config.spring.ServiceBean;
import org.apache.dubbo.config.spring.beans.factory.config.ConfigurableSourceBeanMetadataElement;
import org.apache.dubbo.config.spring.context.DubboLifecycleComponentApplicationListener;
import org.apache.dubbo.config.spring.util.AnnotatedBeanDefinitionRegistryUtils;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
Expand All @@ -38,6 +40,8 @@
import org.springframework.context.annotation.AnnotationConfigUtils;
import org.w3c.dom.Element;

import static org.apache.dubbo.config.spring.util.AnnotatedBeanDefinitionRegistryUtils.registerBeans;

/**
* DubboNamespaceHandler
*
Expand Down Expand Up @@ -76,18 +80,34 @@ public void init() {
*/
@Override
public BeanDefinition parse(Element element, ParserContext parserContext) {
registerAnnotationConfigProcessors(parserContext);
BeanDefinitionRegistry registry = parserContext.getRegistry();
registerAnnotationConfigProcessors(registry);
registerDubboLifecycleComponentApplicationListener(registry);
BeanDefinition beanDefinition = super.parse(element, parserContext);
setSource(beanDefinition);
return beanDefinition;
}

/**
* @param parserContext {@link ParserContext}
* Register {@link DubboLifecycleComponentApplicationListener} as a Spring Bean
*
* @param registry {@link BeanDefinitionRegistry}
* @see DubboLifecycleComponentApplicationListener
* @see AnnotatedBeanDefinitionRegistryUtils#registerBeans(BeanDefinitionRegistry, Class[])
* @since 2.7.4
*/
private void registerAnnotationConfigProcessors(ParserContext parserContext) {
BeanDefinitionRegistry registry = parserContext.getRegistry();
private void registerDubboLifecycleComponentApplicationListener(BeanDefinitionRegistry registry) {
registerBeans(registry, DubboLifecycleComponentApplicationListener.class);
}

/**
* Register the processors for the Spring Annotation-Driven features
*
* @param registry {@link BeanDefinitionRegistry}
* @see AnnotationConfigUtils
* @since 2.7.4
*/
private void registerAnnotationConfigProcessors(BeanDefinitionRegistry registry) {
AnnotationConfigUtils.registerAnnotationConfigProcessors(registry);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
import org.springframework.util.ObjectUtils;

import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Objects;
import java.util.Set;

import static java.lang.String.format;
import static java.util.Arrays.asList;
Expand Down Expand Up @@ -94,8 +95,10 @@ public static void registerBeans(BeanDefinitionRegistry registry, Class<?>... an
return;
}

Set<Class<?>> classesToRegister = new LinkedHashSet<>(asList(annotatedClasses));

// Remove all annotated-classes that have been registered
Iterator<Class<?>> iterator = new ArrayList<>(asList(annotatedClasses)).iterator();
Iterator<Class<?>> iterator = classesToRegister.iterator();

while (iterator.hasNext()) {
Class<?> annotatedClass = iterator.next();
Expand All @@ -110,7 +113,9 @@ public static void registerBeans(BeanDefinitionRegistry registry, Class<?>... an
logger.debug(registry.getClass().getSimpleName() + " will register annotated classes : " + asList(annotatedClasses) + " .");
}

reader.register(annotatedClasses);
reader.register(classesToRegister.toArray(new Class[0]));

// clear
classesToRegister.clear();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.junit.Assert;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.stereotype.Service;
Expand All @@ -36,6 +37,11 @@ public class AnnotatedBeanDefinitionRegistryUtilsTest {

private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();

@BeforeEach
public void init() {
context.setAllowBeanDefinitionOverriding(false);
}

@AfterEach
public void destroy() {
context.close();
Expand All @@ -59,6 +65,9 @@ public void testRegisterBeans() {

registerBeans(context, A.class, A.class);

registerBeans(context, A.class);


context.refresh();

A a = context.getBean(A.class);
Expand Down
14 changes: 14 additions & 0 deletions dubbo-dependencies-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@

<embedded_redis_version>0.6</embedded_redis_version>

<!-- Eureka -->
<eureka.version>1.9.12</eureka.version>

<jaxb_version>2.2.7</jaxb_version>
<activation_version>1.2.0</activation_version>
<test_container_version>1.11.2</test_container_version>
Expand Down Expand Up @@ -256,6 +259,17 @@
<artifactId>embedded-consul</artifactId>
<version>${consul_process_version}</version>
</dependency>
<!-- Eureka -->
<dependency>
<groupId>com.netflix.eureka</groupId>
<artifactId>eureka-client</artifactId>
<version>${eureka.version}</version>
</dependency>
<dependency>
<groupId>com.netflix.eureka</groupId>
<artifactId>eureka-core</artifactId>
<version>${eureka.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.xmemcached</groupId>
<artifactId>xmemcached</artifactId>
Expand Down
45 changes: 45 additions & 0 deletions dubbo-registry/dubbo-registry-eureka/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dubbo-registry-eureka</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>The Eureka registry module of Dubbo project</description>

<dependencies>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-api</artifactId>
<version>${project.parent.version}</version>
</dependency>

<!-- Eureka -->
<dependency>
<groupId>com.netflix.eureka</groupId>
<artifactId>eureka-client</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.netflix.eureka</groupId>
<artifactId>eureka-core</artifactId>
<optional>true</optional>
</dependency>

</dependencies>
</project>
1 change: 1 addition & 0 deletions dubbo-registry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
<module>dubbo-registry-nacos</module>
<module>dubbo-registry-multiple</module>
<module>dubbo-registry-sofa</module>
<module>dubbo-registry-eureka</module>
</modules>
</project>