Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.7.1-release'
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz committed Mar 15, 2019
2 parents 49f6d41 + 32b5757 commit 02689eb
Show file tree
Hide file tree
Showing 69 changed files with 1,225 additions and 2,530 deletions.
98 changes: 98 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,77 @@
# Release Notes

## 2.7.1

### New Features

- nacos support on 2.7 [3582](https://github.com/apache/incubator-dubbo/issues/3582)
- support consul as registry center, config center and metadata center [#983](https://github.com/apache/incubator-dubbo/issues/983)
- etcd registry center support [#808](https://github.com/apache/incubator-dubbo/issues/808)
- metrics support in dubbo 2.7.1 [#3598](https://github.com/apache/incubator-dubbo/issues/3598)
- @Argument @Method support [#2405](https://github.com/apache/incubator-dubbo/issues/2045)

### Enhancement

- [Enhancement] @EnableDubboConfigBinding annotates @Repeatable [#1770](https://github.com/apache/incubator-dubbo/issues/1770)
- Should make annotation easier to use in multiple items circumstance [#3039](https://github.com/apache/incubator-dubbo/issues/3039)
- NoSuchMethodError are thrown when add custom Filter using dubbo2.6.5 and JDK1.6 and upgrade to dubbo2.7.0 [#3570](https://github.com/apache/incubator-dubbo/issues/3570)
- introduce dubbo-dependencies-zookeeper [#3607](https://github.com/apache/incubator-dubbo/pull/3607)
- Zookeeper ConfigCenter reuse the client abstraction and connection session [#3288](https://github.com/apache/incubator-dubbo/issues/3288)
- [Survey] Is it necessary to continue to maintain zkclient in dubbo project? [#3569](https://github.com/apache/incubator-dubbo/issues/3569)
- Start to use IdleStateHandler in Netty4 [#3341](https://github.com/apache/incubator-dubbo/pull/3341)
- Support multiple shared links [#2457](https://github.com/apache/incubator-dubbo/pull/2457)
- Optimize heartbeat [#3299](https://github.com/apache/incubator-dubbo/pull/3299)
- AccessLogFilter simple date format reduce instance creation [#3026](https://github.com/apache/incubator-dubbo/issues/3026)
- Support wildcard ip for tag router rule. [#3289](https://github.com/apache/incubator-dubbo/issues/3289)
- ScriptRouter should cache CompiledScript [#390](https://github.com/apache/incubator-dubbo/issues/390)
- Optimize compareTo in Router to guarantee consistent behaviour. [#3302](https://github.com/apache/incubator-dubbo/issues/3302)
- RMI protocol doesn't support generic invocation [#2779](https://github.com/apache/incubator-dubbo/issues/2779)
- a more elegant way to enhance HashedWheelTimer [#3567](https://github.com/apache/incubator-dubbo/pull/3567)
- obtain local address incorrectly sometimes in dubbo [#538](https://github.com/apache/incubator-dubbo/issues/538)
- implement pull request #3412 on master branch [#3418](https://github.com/apache/incubator-dubbo/pull/3418)
- enhancement for event of response (follow up for pull request #3043) [#3244](https://github.com/apache/incubator-dubbo/issues/3244)
- bump up hessian-lite version #3423 [#3513](https://github.com/apache/incubator-dubbo/pull/3513)

### Bugfixes

- cannot register REST service in 2.7 due to the changes in RestProtoco#getContextPath [#3445](https://github.com/apache/incubator-dubbo/issues/3445)
- Conflict between curator client and dubbo [#3574](https://github.com/apache/incubator-dubbo/issues/3574)
- is there a problem in NettyBackedChannelBuffer.setBytes(...)? [#2619](https://github.com/apache/incubator-dubbo/issues/2619)
- [Dubbo - client always reconnect offline provider] Dubbo client bug [#3158](https://github.com/apache/incubator-dubbo/issues/3158)
- fix heartbeat internal [#3579](https://github.com/apache/incubator-dubbo/pull/3579)
- logic issue in RedisRegistry leads to services cannot be discovered. [#3291](https://github.com/apache/incubator-dubbo/pull/3291)
- Multicast demo fails with message "Can't assign requested address" [#2423](https://github.com/apache/incubator-dubbo/issues/2423)
- Fix thrift protocol, use path to locate exporter. [#3331](https://github.com/apache/incubator-dubbo/pull/3331)
- cannot use override to modify provider's configuration when hessian protocol is used [#900](https://github.com/apache/incubator-dubbo/issues/900)
- Condition is not properly used ? [#1917](https://github.com/apache/incubator-dubbo/issues/1917)
- connectionMonitor in RestProtocol seems not work [#3237](https://github.com/apache/incubator-dubbo/issues/3237)
- fail to parse config text with white space [#3367](https://github.com/apache/incubator-dubbo/issues/3367)
- @Reference check=false doesn't take effect [#195](https://github.com/apache/incubator-dubbo/issues/195)
- [Issue] SpringStatusChecker execute errors on non-XML Spring configuration [#3615](https://github.com/apache/incubator-dubbo/issues/3615)
- monitor's cluster config is set to failsafe and set to failsafe only [#274](https://github.com/apache/incubator-dubbo/issues/274)
- A question for ReferenceConfigCache. [#1293](https://github.com/apache/incubator-dubbo/issues/1293)
- referenceconfig#destroy never invoke unregister [#3294](https://github.com/apache/incubator-dubbo/issues/3294)
- Fix when qos is disable,log will print every time [#3397](https://github.com/apache/incubator-dubbo/pull/3397)
- service group is not supported in generic direct invocation [#3555](https://github.com/apache/incubator-dubbo/issues/3555)
- setOnreturn doesn't take effect in async generic invocation [#208](https://github.com/apache/incubator-dubbo/issues/208)
- Fix timeout filter not work in async way [#3174](https://github.com/apache/incubator-dubbo/pull/3174)
- java.lang.NumberFormatException: For input string: "" [#3069](https://github.com/apache/incubator-dubbo/issues/3069)
- NPE occurred when the configuration was deleted [#3533](https://github.com/apache/incubator-dubbo/issues/3533)
- NPE when package of interface is empty [#3556](https://github.com/apache/incubator-dubbo/issues/3556)
- NPE when exporting rest service using a given path. [#3477](https://github.com/apache/incubator-dubbo/issues/3477)
- NullPointerException happened when using SpringContainer.getContext() [#3476](https://github.com/apache/incubator-dubbo/issues/3476)
- Why does not tomcat throw an exception when `server.start` failed with a socket binding error. [#3236](https://github.com/apache/incubator-dubbo/issues/3236)
- No such extension org.apache.dubbo.metadata.store.MetadataReportFactory by name redis [#3514](https://github.com/apache/incubator-dubbo/issues/3514)
- dubbo 2.7.1-SNAPSHOT NoClassDefFoundError when use springboot [#3426](https://github.com/apache/incubator-dubbo/issues/3426)
- dubbo2.7.0 com.alibaba.com.caucho.hessian.io.HessianProtocolException: 'com.alibaba.dubbo.common.URL' could not be instantiated [#3342](https://github.com/apache/incubator-dubbo/issues/3342)
- Close Resources Properly [#3473](https://github.com/apache/incubator-dubbo/issues/3473)
- SPI entires dup by 3 times. [#2842](https://github.com/apache/incubator-dubbo/issues/2842)
- provider gets wrong interface name from attachment when use generic invocation in 2.6.3 [#2981](https://github.com/apache/incubator-dubbo/issues/2981)
- HashedWheelTimer's queue gets full [#3449](https://github.com/apache/incubator-dubbo/issues/3449)
- Modify MetadataReportRetry ThreadName [#3550](https://github.com/apache/incubator-dubbo/pull/3550)
- Keep interface key in the URL in simplify mode when it's different from path. [#3478](https://github.com/apache/incubator-dubbo/issues/3478)
- nc is not stable in dubbo's bootstrap script [#936](https://github.com/apache/incubator-dubbo/issues/936)

## 2.7.0

Requirements: **Java 8+** required
Expand Down Expand Up @@ -64,6 +136,32 @@ We have always keep compatibility in mind during the whole process of 2.7.0. We

5. Configuration

## 2.6.6

Enhancement / New feature:

* tag route. #3065
* Use Netty4 as default Netty version. #3029
* upporting Java 8 Date/Time type when serializing with Kryo #3519
* supoort config telnet #3511
* add annotation driven in MethodConfig and ArgumentConfig #2603
* add nacos-registry module #3296
* add `protocol` attribute in `@Rerefence` #3555
*support the hierarchical interface in @Service #3251
* change the default behavior in `@EnableDubboConfig.multiple()` #3193
* inline source code of `spring-context-support` #3192
* Simplify externalized configuration of Dubbo Protocol name #3189

BugFix:

* update hessian-lite to 2.3.5, fix unnecessary class load #3538
* Fix unregister when client destroyed(referenceconfig#destroy) #3502
* SPI entires dup by 3 times #3315
* fix Consumer throws RpcException after RegistryDirectory notify in high QPS #2016
* fix NPE in @Reference when using Junit to test dubbo service #3429
* fix consuer always catch java.lang.reflect.UndeclaredThrowableException for any exception throws in provider #3386
* fix the priority of `DubboConfigConfigurationSelector ` #2897
* fix `@Rerefence#parameters()` not work #2301

## 2.6.5

Expand Down
31 changes: 4 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,42 +42,19 @@ There's a [README](https://github.com/apache/incubator-dubbo-samples/tree/master

```xml
<properties>
<dubbo.version>2.7.0</dubbo.version>
<dubbo.version>2.7.1</dubbo.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-bom</artifactId>
<version>${dubbo.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>${dubbo.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
<version>${dubbo.version}</version>
</dependency>
</dependencies>
```
Expand Down
13 changes: 13 additions & 0 deletions dubbo-common/src/main/java/org/apache/dubbo/common/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -840,4 +840,17 @@ public class Constants {

public static final int DEFAULT_GRPC_QUEUES = 300_0000;

/**
* metrics
*/
public static final String DUBBO_PROVIDER = "dubbo.provider";
public static final String DUBBO_CONSUMER = "dubbo.consumer";
public static final String DUBBO_PROVIDER_METHOD = "dubbo.provider.method";
public static final String DUBBO_CONSUMER_METHOD = "dubbo.consumer.method";
public static final String SERVICE = "service";
public static final String METHOD = "method";
public static final String DUBBO_GROUP = "dubbo";
public static final String METRICS_KEY = "metrics";


}
26 changes: 22 additions & 4 deletions dubbo-common/src/main/java/org/apache/dubbo/common/URL.java
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ public InetSocketAddress toInetSocketAddress() {
}

/**
* The format is '{group}/{interfaceName/path}*{version}'
* The format is '{group}*{interfaceName}:{version}'
*
* @return
*/
Expand All @@ -1307,18 +1307,36 @@ public String getEncodedServiceKey() {
return serviceKey;
}

/**
* The format of return value is '{group}/{interfaceName}:{version}'
* @return
*/
public String getServiceKey() {
String inf = getServiceInterface();
if (inf == null) {
return null;
}
return buildKey(inf, getParameter(Constants.GROUP_KEY), getParameter(Constants.VERSION_KEY));
}

/**
* The format of return value is '{group}/{path/interfaceName}:{version}'
* @return
*/
public String getPathKey() {
String inf = StringUtils.isNotEmpty(path) ? path : getServiceInterface();
if (inf == null) {
return null;
}
return buildKey(inf, getParameter(Constants.GROUP_KEY), getParameter(Constants.VERSION_KEY));
}

public static String buildKey(String path, String group, String version) {
StringBuilder buf = new StringBuilder();
String group = getParameter(Constants.GROUP_KEY);
if (group != null && group.length() > 0) {
buf.append(group).append("/");
}
buf.append(inf);
String version = getParameter(Constants.VERSION_KEY);
buf.append(path);
if (version != null && version.length() > 0) {
buf.append(":").append(version);
}
Expand Down
18 changes: 18 additions & 0 deletions dubbo-common/src/test/java/org/apache/dubbo/common/URLTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -687,4 +687,22 @@ public void testDefaultPort() {
Assertions.assertEquals("10.20.153.10:2181", URL.appendDefaultPort("10.20.153.10:0", 2181));
Assertions.assertEquals("10.20.153.10:2181", URL.appendDefaultPort("10.20.153.10", 2181));
}

@Test
public void testGetServiceKey () {
URL url1 = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName");
Assertions.assertEquals("org.apache.dubbo.test.interfaceName", url1.getServiceKey());

URL url2 = URL.valueOf("10.20.130.230:20880/org.apache.dubbo.test.interfaceName?interface=org.apache.dubbo.test.interfaceName");
Assertions.assertEquals("org.apache.dubbo.test.interfaceName", url2.getServiceKey());

URL url3 = URL.valueOf("10.20.130.230:20880/org.apache.dubbo.test.interfaceName?interface=org.apache.dubbo.test.interfaceName&group=group1&version=1.0.0");
Assertions.assertEquals("group1/org.apache.dubbo.test.interfaceName:1.0.0", url3.getServiceKey());

URL url4 = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName");
Assertions.assertEquals("context/path", url4.getPathKey());

URL url5 = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName&group=group1&version=1.0.0");
Assertions.assertEquals("group1/context/path:1.0.0", url5.getPathKey());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.dubbo.config;

import org.apache.dubbo.config.annotation.Argument;
import org.apache.dubbo.config.support.Parameter;

import java.io.Serializable;
Expand Down Expand Up @@ -44,6 +45,15 @@ public class ArgumentConfig implements Serializable {
*/
private Boolean callback;

public ArgumentConfig() {
}

public ArgumentConfig(Argument argument) {
this.index = argument.index();
this.type = argument.type();
this.callback = argument.callback();
}

@Parameter(excluded = true)
public Integer getIndex() {
return index;
Expand All @@ -70,4 +80,4 @@ public Boolean isCallback() {
return callback;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@

import org.apache.dubbo.common.Constants;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.config.annotation.Method;
import org.apache.dubbo.config.support.Parameter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
Expand Down Expand Up @@ -117,6 +120,46 @@ public String getName() {
return name;
}

public MethodConfig() {
}

public MethodConfig(Method method) {
appendAnnotation(Method.class, method);

this.setReturn(method.isReturn());

if(!"".equals(method.oninvoke())){
this.setOninvoke(method.oninvoke());
}
if(!"".equals(method.onreturn())){
this.setOnreturn(method.onreturn());
}
if(!"".equals(method.onthrow())){
this.setOnthrow(method.onthrow());
}

if (method.arguments() != null && method.arguments().length != 0) {
List<ArgumentConfig> argumentConfigs = new ArrayList<ArgumentConfig>(method.arguments().length);
this.setArguments(argumentConfigs);
for (int i = 0; i < method.arguments().length; i++) {
ArgumentConfig argumentConfig = new ArgumentConfig(method.arguments()[i]);
argumentConfigs.add(argumentConfig);
}
}
}

public static List<MethodConfig> constructMethodConfig(Method[] methods) {
if (methods != null && methods.length != 0) {
List<MethodConfig> methodConfigs = new ArrayList<MethodConfig>(methods.length);
for (int i = 0; i < methods.length; i++) {
MethodConfig methodConfig = new MethodConfig(methods[i]);
methodConfigs.add(methodConfig);
}
return methodConfigs;
}
return Collections.emptyList();
}

public void setName(String name) {
checkMethodName("name", name);
this.name = name;
Expand Down Expand Up @@ -279,4 +322,4 @@ public String getPrefix() {
+ (StringUtils.isEmpty(serviceId) ? "" : ("." + serviceId))
+ "." + getName();
}
}
}
Loading

0 comments on commit 02689eb

Please sign in to comment.