Skip to content

Commit

Permalink
Fixed a bug where the provider did not correctly inject the token's U…
Browse files Browse the repository at this point in the history
…UID into the registry when the token was set to true; added the missing dubbo-remoting-etcd3 and dubbo-registry-eureka modules in dubbo-all / pom.xml (#5697)
  • Loading branch information
manzhizhen committed Jan 31, 2020
1 parent 28ec1f8 commit 8bec976
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
18 changes: 17 additions & 1 deletion dubbo-all/pom.xml
Expand Up @@ -93,6 +93,13 @@
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-remoting-etcd3</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-remoting-mina</artifactId>
Expand Down Expand Up @@ -278,6 +285,13 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-eureka</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-nacos</artifactId>
Expand Down Expand Up @@ -602,6 +616,7 @@
<include>org.apache.dubbo:dubbo-remoting-api</include>
<include>org.apache.dubbo:dubbo-remoting-netty</include>
<include>org.apache.dubbo:dubbo-remoting-netty4</include>
<include>org.apache.dubbo:dubbo-remoting-etcd3</include>
<include>org.apache.dubbo:dubbo-remoting-mina</include>
<include>org.apache.dubbo:dubbo-remoting-grizzly</include>
<include>org.apache.dubbo:dubbo-remoting-p2p</include>
Expand All @@ -615,6 +630,7 @@
<include>org.apache.dubbo:dubbo-rpc-hessian</include>
<include>org.apache.dubbo:dubbo-rpc-webservice</include>
<include>org.apache.dubbo:dubbo-rpc-thrift</include>
<include>org.apache.dubbo:dubbo-rpc-native-thrift</include>
<include>org.apache.dubbo:dubbo-rpc-memcached</include>
<include>org.apache.dubbo:dubbo-rpc-redis</include>
<include>org.apache.dubbo:dubbo-rpc-rest</include>
Expand All @@ -630,6 +646,7 @@
<include>org.apache.dubbo:dubbo-registry-redis</include>
<include>org.apache.dubbo:dubbo-registry-consul</include>
<include>org.apache.dubbo:dubbo-registry-etcd3</include>
<include>org.apache.dubbo:dubbo-registry-eureka</include>
<include>org.apache.dubbo:dubbo-registry-nacos</include>
<include>org.apache.dubbo:dubbo-registry-sofa</include>
<include>org.apache.dubbo:dubbo-registry-multiple</include>
Expand Down Expand Up @@ -664,7 +681,6 @@
<include>org.apache.dubbo:dubbo-metadata-report-etcd</include>
<include>org.apache.dubbo:dubbo-metadata-report-nacos</include>
<include>org.apache.dubbo:dubbo-serialization-native-hession</include>
<include>org.apache.dubbo:dubbo-rpc-native-thrift</include>
</includes>
</artifactSet>
<transformers>
Expand Down
Expand Up @@ -412,6 +412,14 @@ private void doExportUrlsFor1Protocol(ProtocolConfig protocolConfig, List<URL> r
map.put(METHODS_KEY, StringUtils.join(new HashSet<String>(Arrays.asList(methods)), ","));
}
}

/**
* Here the token value configured by the provider is used to assign the value to ServiceConfig#token
*/
if(ConfigUtils.isEmpty(token) && provider != null) {
token = provider.getToken();
}

if (!ConfigUtils.isEmpty(token)) {
if (ConfigUtils.isDefault(token)) {
map.put(TOKEN_KEY, UUID.randomUUID().toString());
Expand Down

0 comments on commit 8bec976

Please sign in to comment.