You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/12/06 14:00:33 UTC

[GitHub] [dubbo-spi-extensions] wxbty opened a new pull request, #182: Bugfix of retries and missing field

wxbty opened a new pull request, #182:
URL: https://github.com/apache/dubbo-spi-extensions/pull/182

   ## What is the purpose of the change
   
   Issue Number: close #181 
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-spi-extensions] wxbty commented on pull request #182: Bugfix of retries and missing field

Posted by GitBox <gi...@apache.org>.
wxbty commented on PR #182:
URL: https://github.com/apache/dubbo-spi-extensions/pull/182#issuecomment-1343728361

   > It would be better to add a Filter/ClusterFilter to remove `Address` from TheadLocal and put into invocation's arrtibutes.
   
   done


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-spi-extensions] AlbumenJ commented on a diff in pull request #182: Bugfix of retries and missing field

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #182:
URL: https://github.com/apache/dubbo-spi-extensions/pull/182#discussion_r1046745129


##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-dubbo3/pom.xml:
##########
@@ -27,14 +27,19 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>dubbo-cluster-specify-address-dubbo3</artifactId>
-    <version>1.0.2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>
             <groupId>org.apache.dubbo</groupId>
             <artifactId>dubbo</artifactId>
             <optional>true</optional>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.dubbo.extensions</groupId>
+            <artifactId>dubbo-cluster-specify-address-common</artifactId>
+            <version>${revision}</version>

Review Comment:
   ```suggestion
               <version>${project.version}</version>
   ```



##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-dubbo3/pom.xml:
##########
@@ -27,14 +27,19 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>dubbo-cluster-specify-address-dubbo3</artifactId>
-    <version>1.0.2-SNAPSHOT</version>

Review Comment:
   do not remove this tag



##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-common/pom.xml:
##########
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+  -->
+<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">
+    <parent>
+        <artifactId>dubbo-cluster-extensions</artifactId>
+        <groupId>org.apache.dubbo.extensions</groupId>
+        <version>${revision}</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>dubbo-cluster-specify-address-common</artifactId>

Review Comment:
   add
   `<version>1.0.2-SNAPSHOT</version>`



##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-common/pom.xml:
##########
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+  -->
+<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">
+    <parent>
+        <artifactId>dubbo-cluster-extensions</artifactId>
+        <groupId>org.apache.dubbo.extensions</groupId>
+        <version>${revision}</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>dubbo-cluster-specify-address-common</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.dubbo</groupId>
+            <artifactId>dubbo-common</artifactId>
+            <version>2.7.18</version>
+        </dependency>

Review Comment:
   remove this dependency



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-spi-extensions] codecov-commenter commented on pull request #182: Bugfix of retries and missing field

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #182:
URL: https://github.com/apache/dubbo-spi-extensions/pull/182#issuecomment-1352627159

   # [Codecov](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#182](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aad1426) into [master](https://codecov.io/gh/apache/dubbo-spi-extensions/commit/12a5931ed2f217e4f63c6ce6c927a519c502aa22?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (12a5931) will **increase** coverage by `1.82%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #182      +/-   ##
   ============================================
   + Coverage     36.22%   38.05%   +1.82%     
   + Complexity      556      463      -93     
   ============================================
     Files           159      136      -23     
     Lines          5626     4428    -1198     
     Branches        692      569     -123     
   ============================================
   - Hits           2038     1685     -353     
   + Misses         3354     2547     -807     
   + Partials        234      196      -38     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...che/dubbo/remoting/transport/mina/MinaChannel.java](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc3BpLWV4dGVuc2lvbnMvZHViYm8tcmVtb3RpbmctZXh0ZW5zaW9ucy9kdWJiby1yZW1vdGluZy1taW5hL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvbWluYS9NaW5hQ2hhbm5lbC5qYXZh) | `35.52% <0.00%> (-10.53%)` | :arrow_down: |
   | [...org/apache/dubbo/registry/redis/RedisRegistry.java](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc3BpLWV4dGVuc2lvbnMvZHViYm8tcmVnaXN0cnktZXh0ZW5zaW9ucy9kdWJiby1yZWdpc3RyeS1yZWRpcy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcmVnaXN0cnkvcmVkaXMvUmVkaXNSZWdpc3RyeS5qYXZh) | `52.05% <0.00%> (-2.63%)` | :arrow_down: |
   | [...he/dubbo/rpc/protocol/hessian/HessianProtocol.java](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc3BpLWV4dGVuc2lvbnMvZHViYm8tcnBjLWV4dGVuc2lvbnMvZHViYm8tcnBjLWhlc3NpYW4vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC9oZXNzaWFuL0hlc3NpYW5Qcm90b2NvbC5qYXZh) | `77.64% <0.00%> (-2.36%)` | :arrow_down: |
   | [...ter/specifyaddress/UserSpecifiedAddressRouter.java](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc3BpLWV4dGVuc2lvbnMvZHViYm8tY2x1c3Rlci1leHRlbnNpb25zL2R1YmJvLWNsdXN0ZXItc3BlY2lmeS1hZGRyZXNzLWR1YmJvMi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcnBjL2NsdXN0ZXIvc3BlY2lmeWFkZHJlc3MvVXNlclNwZWNpZmllZEFkZHJlc3NSb3V0ZXIuamF2YQ==) | `78.23% <0.00%> (-1.23%)` | :arrow_down: |
   | [...ter/specifyaddress/UserSpecifiedAddressRouter.java](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc3BpLWV4dGVuc2lvbnMvZHViYm8tY2x1c3Rlci1leHRlbnNpb25zL2R1YmJvLWNsdXN0ZXItc3BlY2lmeS1hZGRyZXNzLWR1YmJvMy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcnBjL2NsdXN0ZXIvc3BlY2lmeWFkZHJlc3MvVXNlclNwZWNpZmllZEFkZHJlc3NSb3V0ZXIuamF2YQ==) | `85.71% <0.00%> (-0.62%)` | :arrow_down: |
   | [...ubbo/remoting/etcd/support/AbstractEtcdClient.java](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc3BpLWV4dGVuc2lvbnMvZHViYm8tcmVtb3RpbmctZXh0ZW5zaW9ucy9kdWJiby1yZW1vdGluZy1ldGNkMy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcmVtb3RpbmcvZXRjZC9zdXBwb3J0L0Fic3RyYWN0RXRjZENsaWVudC5qYXZh) | | |
   | [...he/dubbo/remoting/etcd/jetcd/JEtcdTransporter.java](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc3BpLWV4dGVuc2lvbnMvZHViYm8tcmVtb3RpbmctZXh0ZW5zaW9ucy9kdWJiby1yZW1vdGluZy1ldGNkMy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcmVtb3RpbmcvZXRjZC9qZXRjZC9KRXRjZFRyYW5zcG9ydGVyLmphdmE=) | | |
   | [.../dubbo/metadata/store/etcd/EtcdMetadataReport.java](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc3BpLWV4dGVuc2lvbnMvZHViYm8tbWV0YWRhdGEtcmVwb3J0LWV4dGVuc2lvbnMvZHViYm8tbWV0YWRhdGEtcmVwb3J0LWV0Y2Qvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL21ldGFkYXRhL3N0b3JlL2V0Y2QvRXRjZE1ldGFkYXRhUmVwb3J0LmphdmE=) | | |
   | [...registry/consul/ConsulServiceDiscoveryFactory.java](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc3BpLWV4dGVuc2lvbnMvZHViYm8tcmVnaXN0cnktZXh0ZW5zaW9ucy9kdWJiby1yZWdpc3RyeS1jb25zdWwvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JlZ2lzdHJ5L2NvbnN1bC9Db25zdWxTZXJ2aWNlRGlzY292ZXJ5RmFjdG9yeS5qYXZh) | | |
   | [.../support/etcd/EtcdDynamicConfigurationFactory.java](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tc3BpLWV4dGVuc2lvbnMvZHViYm8tY29uZmlnY2VudGVyLWV4dGVuc2lvbnMvZHViYm8tY29uZmlnY2VudGVyLWV0Y2Qvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZ2NlbnRlci9zdXBwb3J0L2V0Y2QvRXRjZER5bmFtaWNDb25maWd1cmF0aW9uRmFjdG9yeS5qYXZh) | | |
   | ... and [22 more](https://codecov.io/gh/apache/dubbo-spi-extensions/pull/182/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-spi-extensions] wxbty commented on a diff in pull request #182: Bugfix of retries and missing field

Posted by GitBox <gi...@apache.org>.
wxbty commented on code in PR #182:
URL: https://github.com/apache/dubbo-spi-extensions/pull/182#discussion_r1046589787


##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-dubbo2/src/main/java/org/apache/dubbo/rpc/cluster/specifyaddress/Address.java:
##########
@@ -17,10 +17,15 @@
 package org.apache.dubbo.rpc.cluster.specifyaddress;
 
 import org.apache.dubbo.common.URL;
+import org.apache.dubbo.rpc.cluster.common.SpecifyAddress;
 
 import java.io.Serializable;
 import java.util.Objects;
 
+/**
+ * Use {@link SpecifyAddress} instead.
+ */
+@Deprecated
 public class Address implements Serializable {

Review Comment:
   URL attributes are always cast when used, using Object instead of generics so that they can be placed in the common package



##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-dubbo2/src/main/java/org/apache/dubbo/rpc/cluster/specifyaddress/Address.java:
##########
@@ -17,10 +17,15 @@
 package org.apache.dubbo.rpc.cluster.specifyaddress;
 
 import org.apache.dubbo.common.URL;
+import org.apache.dubbo.rpc.cluster.common.SpecifyAddress;
 
 import java.io.Serializable;
 import java.util.Objects;
 
+/**
+ * Use {@link SpecifyAddress} instead.
+ */
+@Deprecated
 public class Address implements Serializable {

Review Comment:
   The Address can then be placed in the common package



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-spi-extensions] AlbumenJ commented on a diff in pull request #182: Bugfix of retries and missing field

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #182:
URL: https://github.com/apache/dubbo-spi-extensions/pull/182#discussion_r1045346547


##########
dubbo-cluster-extensions/dubbo-cluster-common/pom.xml:
##########
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"

Review Comment:
   Please add ASF license header for this file



##########
dubbo-cluster-extensions/dubbo-cluster-common/pom.xml:
##########
@@ -0,0 +1,16 @@
+<?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">
+    <parent>
+        <artifactId>dubbo-cluster-extensions</artifactId>
+        <groupId>org.apache.dubbo.extensions</groupId>
+        <version>${revision}</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>dubbo-cluster-common</artifactId>

Review Comment:
   Would this module rename to `dubbo-cluster-sprcify-address-common` be better?



##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-dubbo2/src/main/java/org/apache/dubbo/rpc/cluster/specifyaddress/AddressSpecifyClusterInterceptor.java:
##########
@@ -0,0 +1,32 @@
+package org.apache.dubbo.rpc.cluster.specifyaddress;

Review Comment:
   Please add asf license header



##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-dubbo2/src/main/java/org/apache/dubbo/rpc/cluster/specifyaddress/Address.java:
##########
@@ -17,10 +17,15 @@
 package org.apache.dubbo.rpc.cluster.specifyaddress;
 
 import org.apache.dubbo.common.URL;
+import org.apache.dubbo.rpc.cluster.common.SpecifyAddress;
 
 import java.io.Serializable;
 import java.util.Objects;
 
+/**
+ * Use {@link SpecifyAddress} instead.
+ */
+@Deprecated
 public class Address implements Serializable {

Review Comment:
   extend `org.apache.dubbo.rpc.cluster.common.SpecifyAddress`



##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-dubbo2/src/main/java/org/apache/dubbo/rpc/cluster/specifyaddress/Address.java:
##########
@@ -17,10 +17,15 @@
 package org.apache.dubbo.rpc.cluster.specifyaddress;
 
 import org.apache.dubbo.common.URL;
+import org.apache.dubbo.rpc.cluster.common.SpecifyAddress;
 
 import java.io.Serializable;
 import java.util.Objects;
 
+/**
+ * Use {@link SpecifyAddress} instead.
+ */
+@Deprecated
 public class Address implements Serializable {

Review Comment:
   Or move this class to common module without change its package



##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-dubbo2/src/main/java/org/apache/dubbo/rpc/cluster/specifyaddress/AddressSpecifyClusterInterceptor.java:
##########
@@ -0,0 +1,32 @@
+package org.apache.dubbo.rpc.cluster.specifyaddress;
+
+import org.apache.dubbo.common.URL;
+import org.apache.dubbo.common.constants.CommonConstants;
+import org.apache.dubbo.common.extension.Activate;
+import org.apache.dubbo.rpc.Invocation;
+import org.apache.dubbo.rpc.RpcContext;
+import org.apache.dubbo.rpc.cluster.common.SpecifyAddress;
+import org.apache.dubbo.rpc.cluster.interceptor.ClusterInterceptor;
+import org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker;
+
+/**
+ * The SPECIFY ADDRESS field is handed over to the attachment by the thread
+ */
+@Activate(group = CommonConstants.CONSUMER)
+public class AddressSpecifyClusterInterceptor implements ClusterInterceptor {
+
+    @Override
+    public void before(AbstractClusterInvoker<?> clusterInvoker, Invocation invocation) {
+        SpecifyAddress<URL> current = UserSpecifiedAddressUtil.current();
+        if (current != null) {
+            invocation.setAttachment(SpecifyAddress.name, current);

Review Comment:
   set to attribute, not attachment



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-spi-extensions] AlbumenJ commented on a diff in pull request #182: Bugfix of retries and missing field

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #182:
URL: https://github.com/apache/dubbo-spi-extensions/pull/182#discussion_r1048070404


##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-common/src/main/java/org/apache/dubbo/rpc/cluster/specifyaddress/Address.java:
##########
@@ -16,35 +16,43 @@
  */
 package org.apache.dubbo.rpc.cluster.specifyaddress;
 
-import org.apache.dubbo.common.URL;
-
 import java.io.Serializable;
 import java.util.Objects;
 
 public class Address implements Serializable {
+
+    public static final String name = "specifyAddress";
+
     // ip - priority: 3
     private String ip;
 
     // ip+port - priority: 2
     private int port;
 
     // address - priority: 1
-    private URL urlAddress;
+    private Object urlAddress;

Review Comment:
   ```suggestion
       private URL urlAddress;
   ```
   
   Since dubbo is added to dependencies, `URL` can be depend on here.



##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-common/pom.xml:
##########
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+  -->
+<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">
+    <parent>
+        <artifactId>dubbo-cluster-extensions</artifactId>
+        <groupId>org.apache.dubbo.extensions</groupId>
+        <version>${revision}</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>dubbo-cluster-specify-address-common</artifactId>
+    <version>1.0.2-SNAPSHOT</version>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.dubbo</groupId>
+            <artifactId>dubbo-common</artifactId>
+            <version>3.1.3</version>

Review Comment:
   Remove this tag. The latest dubbo version should be managed by `dubbo-extensions-dependencies-bom`



##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-common/src/main/java/org/apache/dubbo/rpc/cluster/specifyaddress/UserSpecifiedAddressUtil.java:
##########
@@ -30,12 +30,11 @@ public static void setAddress(Address address) {
         ADDRESS.set(address);
     }
 
-    public static Address getAddress() {
-        try {
-            return ADDRESS.get();
-        } finally {
-            // work once
-            ADDRESS.remove();
-        }
+    public static Address current() {
+        return ADDRESS.get();
+    }
+
+    public static void removeAddress() {
+        ADDRESS.remove();

Review Comment:
   If there is no gain, my suggestion is to not change this part.



##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-dubbo2/src/main/java/org/apache/dubbo/rpc/cluster/specifyaddress/AddressSpecifyClusterInterceptor.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.rpc.cluster.specifyaddress;
+
+import org.apache.dubbo.common.constants.CommonConstants;
+import org.apache.dubbo.common.extension.Activate;
+import org.apache.dubbo.rpc.Invocation;
+import org.apache.dubbo.rpc.cluster.interceptor.ClusterInterceptor;
+import org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker;
+
+/**
+ * The SPECIFY ADDRESS field is handed over to the attachment by the thread
+ */
+@Activate(group = CommonConstants.CONSUMER)
+public class AddressSpecifyClusterInterceptor implements ClusterInterceptor {
+
+    @Override
+    public void before(AbstractClusterInvoker<?> clusterInvoker, Invocation invocation) {
+        Address current = UserSpecifiedAddressUtil.current();

Review Comment:
   ```suggestion
           Address current = UserSpecifiedAddressUtil.getAddress();
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-spi-extensions] AlbumenJ merged pull request #182: Bugfix of retries and missing field

Posted by GitBox <gi...@apache.org>.
AlbumenJ merged PR #182:
URL: https://github.com/apache/dubbo-spi-extensions/pull/182


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-spi-extensions] wxbty commented on a diff in pull request #182: Bugfix of retries and missing field

Posted by GitBox <gi...@apache.org>.
wxbty commented on code in PR #182:
URL: https://github.com/apache/dubbo-spi-extensions/pull/182#discussion_r1046589101


##########
dubbo-cluster-extensions/dubbo-cluster-specify-address-dubbo2/src/main/java/org/apache/dubbo/rpc/cluster/specifyaddress/Address.java:
##########
@@ -17,10 +17,15 @@
 package org.apache.dubbo.rpc.cluster.specifyaddress;
 
 import org.apache.dubbo.common.URL;
+import org.apache.dubbo.rpc.cluster.common.SpecifyAddress;
 
 import java.io.Serializable;
 import java.util.Objects;
 
+/**
+ * Use {@link SpecifyAddress} instead.
+ */
+@Deprecated
 public class Address implements Serializable {

Review Comment:
   URL attributes are always cast when used, using Object instead of generics so that they can be placed in the common package



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org