You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2024/04/10 05:15:43 UTC
(dubbo) 01/01: Merge branch 'apache-3.2' into apache-3.3
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git
commit 53553dcef4866a16eba4803c86b6885c38ea0e90
Merge: 0840c60e54 45b5d44064
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Wed Apr 10 13:15:14 2024 +0800
Merge branch 'apache-3.2' into apache-3.3
# Conflicts:
# dubbo-container/dubbo-container-api/src/main/java/org/apache/dubbo/container/Main.java
# dubbo-dependencies-bom/pom.xml
# dubbo-distribution/dubbo-apache-release/pom.xml
# dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/support/AbstractMonitorFactory.java
# dubbo-remoting/dubbo-remoting-http12/pom.xml
# dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h12/AbstractServerCallListener.java
# dubbo-spring-boot/pom.xml
# dubbo-test/dubbo-test-spring/pom.xml
.../dubbo/rpc/cluster/SingleRouterChain.java | 6 ++--
.../cluster/configurator/AbstractConfigurator.java | 2 +-
.../loadbalance/ConsistentHashLoadBalance.java | 5 ++-
.../apache/dubbo/rpc/cluster/merger/MapMerger.java | 2 +-
.../dubbo/rpc/cluster/merger/MergerFactory.java | 2 +-
.../apache/dubbo/rpc/cluster/merger/SetMerger.java | 2 +-
.../condition/ConditionStateRouterFactory.java | 2 +-
.../config/ServiceStateRouterFactory.java | 2 +-
.../cluster/router/mesh/route/MeshRuleCache.java | 2 +-
.../router/mock/MockStateRouterFactory.java | 2 +-
.../cluster/router/tag/TagStateRouterFactory.java | 2 +-
.../cluster/support/FailoverClusterInvoker.java | 4 +--
.../rpc/cluster/support/MergeableCluster.java | 2 +-
.../cluster/support/registry/ZoneAwareCluster.java | 2 +-
.../support/wrapper/MockClusterWrapper.java | 2 +-
.../main/java/org/apache/dubbo/common/Version.java | 2 +-
.../common/beanutil/JavaBeanSerializeUtil.java | 6 ++--
.../org/apache/dubbo/common/bytecode/Mixin.java | 2 +-
.../org/apache/dubbo/common/bytecode/Wrapper.java | 4 +--
.../dubbo/common/compiler/support/ClassUtils.java | 2 +-
.../common/threadlocal/InternalThreadLocalMap.java | 2 +-
.../dubbo/common/timer/HashedWheelTimer.java | 2 +-
.../org/apache/dubbo/common/utils/CIDRUtils.java | 2 +-
.../org/apache/dubbo/common/utils/ConfigUtils.java | 4 +--
.../org/apache/dubbo/common/utils/IOUtils.java | 2 +-
.../java/org/apache/dubbo/common/utils/Stack.java | 2 +-
.../org/apache/dubbo/common/utils/StringUtils.java | 4 +--
.../org/apache/dubbo/common/utils/UrlUtils.java | 2 +-
.../dubbo/config/AbstractInterfaceConfig.java | 2 +-
.../java/org/apache/dubbo/config/ModuleConfig.java | 2 +-
.../dubbo/metadata/definition/util/ClassUtils.java | 2 +-
.../org/apache/dubbo/rpc/model/ProviderModel.java | 2 +-
.../dubbo/cache/support/AbstractCacheFactory.java | 2 +-
.../com/alibaba/dubbo/config/ServiceConfig.java | 2 +-
.../com/alibaba/dubbo/container/page/Page.java | 4 +--
.../alibaba/dubbo/container/page/PageServlet.java | 4 +--
.../dubbo/container/page/ResourceFilter.java | 2 +-
.../container/page/pages/HomePageHandler.java | 4 +--
.../dubbo/container/page/pages/LogPageHandler.java | 4 +--
.../container/page/pages/StatusPageHandler.java | 8 ++---
.../container/page/pages/SystemPageHandler.java | 18 +++++-----
.../java/com/alibaba/dubbo/rpc/RpcContext.java | 2 +-
.../java/com/alibaba/dubbo/rpc/RpcInvocation.java | 6 ++--
.../org/apache/dubbo/config/ReferenceConfig.java | 1 +
.../org/apache/dubbo/config/ServiceConfig.java | 4 +--
.../dubbo/config/utils/ConfigValidationUtils.java | 4 +--
dubbo-config/dubbo-config-spring/pom.xml | 2 +-
.../AbstractAnnotationBeanPostProcessor.java | 5 ++-
.../dubbo/config/spring/util/AnnotationUtils.java | 4 +--
.../config/spring/util/PropertySourcesUtils.java | 2 +-
.../dubbo-configcenter-nacos/pom.xml | 28 +++++++--------
.../dubbo-demo-annotation-consumer/pom.xml | 30 ++++++++--------
dubbo-demo/dubbo-demo-annotation/pom.xml | 30 ++++++++--------
.../dubbo-demo-api/dubbo-demo-api-consumer/pom.xml | 30 ++++++++--------
dubbo-demo/dubbo-demo-api/pom.xml | 30 ++++++++--------
dubbo-demo/dubbo-demo-generic-call/pom.xml | 30 ++++++++--------
.../dubbo-demo-native-consumer/pom.xml | 2 +-
.../dubbo-demo-native-provider/pom.xml | 2 +-
dubbo-demo/dubbo-demo-triple/pom.xml | 32 ++++++++---------
dubbo-dependencies-bom/pom.xml | 22 ++++++------
.../dubbo-dependencies-zookeeper-curator5/pom.xml | 28 +++++++--------
.../dubbo-dependencies-zookeeper/pom.xml | 28 +++++++--------
dubbo-distribution/dubbo-apache-release/pom.xml | 2 +-
dubbo-maven-plugin/pom.xml | 4 +--
dubbo-metadata/dubbo-metadata-processor/pom.xml | 28 +++++++--------
dubbo-metadata/dubbo-metadata-report-nacos/pom.xml | 28 +++++++--------
.../metadata/store/nacos/NacosMetadataReport.java | 2 +-
.../dubbo/cache/support/AbstractCacheFactory.java | 2 +-
.../dubbo/cache/support/expiring/ExpiringMap.java | 2 +-
.../qos/command/decoder/HttpCommandDecoder.java | 4 +--
.../apache/dubbo/qos/command/impl/CountTelnet.java | 6 ++--
.../dubbo/qos/command/util/CommandHelper.java | 2 +-
.../java/org/apache/dubbo/qos/textui/TLadder.java | 2 +-
.../java/org/apache/dubbo/qos/textui/TTable.java | 2 +-
.../java/org/apache/dubbo/qos/textui/TTree.java | 2 +-
.../dubbo/reactive/calls/ReactorServerCalls.java | 4 +--
.../InterfaceCompatibleRegistryProtocol.java | 2 +-
.../registry/multicast/MulticastRegistry.java | 6 ++--
.../dubbo/registry/multiple/MultipleRegistry.java | 2 +-
.../exchange/support/ReplierDispatcher.java | 2 +-
.../support/header/HeaderExchangeServer.java | 2 +-
.../dubbo/remoting/telnet/codec/TelnetCodec.java | 2 +-
.../telnet/support/command/HelpTelnetHandler.java | 4 +--
.../support/command/StatusTelnetHandler.java | 10 +++---
.../dubbo/remoting/transport/AbstractClient.java | 42 ++++++++++++++++++++++
.../dubbo/remoting/transport/CodecSupport.java | 6 ++--
.../dubbo/remoting/http/RequestTemplate.java | 4 +--
.../remoting/http/servlet/DispatcherServlet.java | 2 +-
.../remoting/http/servlet/ServletManager.java | 2 +-
.../remoting/transport/netty/NettyChannel.java | 4 +--
.../remoting/transport/netty/NettyHandler.java | 2 +-
.../remoting/transport/netty4/NettyChannel.java | 5 ++-
.../transport/netty4/NettyConnectionClient.java | 21 ++++++++---
.../remoting/transport/netty4/ConnectionTest.java | 3 ++
.../org/apache/dubbo/rpc/RpcServiceContext.java | 2 +-
.../main/java/org/apache/dubbo/rpc/RpcStatus.java | 7 ++--
.../apache/dubbo/rpc/filter/DeprecatedFilter.java | 2 +-
.../dubbo/rpc/filter/tps/DefaultTPSLimiter.java | 2 +-
.../dubbo/rpc/protocol/AbstractProxyProtocol.java | 2 +-
.../rpc/protocol/ProtocolListenerWrapper.java | 3 +-
.../org/apache/dubbo/rpc/support/MockInvoker.java | 4 +--
.../dubbo/rpc/protocol/dubbo/DubboProtocol.java | 4 +--
.../dubbo/rpc/protocol/injvm/InjvmProtocol.java | 4 +--
.../dubbo/rpc/protocol/rest/RestProtocol.java | 2 +-
.../dubbo/rpc/protocol/rest/ViolationReport.java | 2 +-
.../DubboPreMatchContainerRequestContext.java | 2 +-
.../dubbo/rpc/protocol/rest/util/ReflectUtils.java | 2 +-
.../protocol/tri/TriHttp2RemoteFlowController.java | 2 +-
.../tri/h12/AbstractServerCallListener.java | 8 +++--
.../dubbo-nacos-spring-boot-starter/pom.xml | 28 +++++++--------
.../pom.xml | 28 +++++++--------
.../dubbo-zookeeper-spring-boot-starter/pom.xml | 28 +++++++--------
.../dubbo-spring-boot-starters/pom.xml | 28 +++++++--------
dubbo-spring-boot/pom.xml | 2 +-
.../org/apache/dubbo/test/common/SysProps.java | 2 +-
dubbo-test/dubbo-test-spring3.2/pom.xml | 2 +-
dubbo-test/dubbo-test-spring4.1/pom.xml | 2 +-
dubbo-test/dubbo-test-spring4.2/pom.xml | 2 +-
pom.xml | 6 ++--
119 files changed, 442 insertions(+), 398 deletions(-)
diff --cc dubbo-compatible/src/main/java/com/alibaba/dubbo/container/page/pages/SystemPageHandler.java
index 84c3e9439a,d771c061e9..2eebd49702
--- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/container/page/pages/SystemPageHandler.java
+++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/container/page/pages/SystemPageHandler.java
@@@ -60,35 -58,30 +60,35 @@@ public class SystemPageHandler implemen
row.add(NetUtils.getHostName(address) + "/" + address);
rows.add(row);
- row = new ArrayList<String>();
+ row = new ArrayList<>();
row.add("OS");
- row.add(System.getProperty("os.name") + " " + System.getProperty("os.version"));
+ row.add(SystemPropertyConfigUtils.getSystemProperty(CommonConstants.SystemProperty.SYSTEM_OS_NAME) + " "
+ + SystemPropertyConfigUtils.getSystemProperty(CommonConstants.SystemProperty.SYSTEM_OS_VERSION));
rows.add(row);
- row = new ArrayList<String>();
+ row = new ArrayList<>();
row.add("JVM");
- row.add(System.getProperty("java.runtime.name") + " " + System.getProperty("java.runtime.version") + ",<br/>"
- + System.getProperty("java.vm.name") + " " + System.getProperty("java.vm.version") + " "
- + System.getProperty("java.vm.info", ""));
+ row.add(SystemPropertyConfigUtils.getSystemProperty(CommonConstants.SystemProperty.JAVA_RUNTIME_NAME) + " "
+ + SystemPropertyConfigUtils.getSystemProperty(CommonConstants.SystemProperty.JAVA_RUNTIME_VERSION)
+ + ",<br/>"
+ + SystemPropertyConfigUtils.getSystemProperty(CommonConstants.SystemProperty.JAVA_VM_NAME) + " "
+ + SystemPropertyConfigUtils.getSystemProperty(CommonConstants.SystemProperty.JAVA_VM_VERSION) + " "
+ + SystemPropertyConfigUtils.getSystemProperty(CommonConstants.SystemProperty.JAVA_VM_INFO, ""));
rows.add(row);
- row = new ArrayList<String>();
+ row = new ArrayList<>();
row.add("CPU");
- row.add(System.getProperty("os.arch", "") + ", "
+ row.add(SystemPropertyConfigUtils.getSystemProperty(CommonConstants.SystemProperty.OS_ARCH, "") + ", "
+ String.valueOf(Runtime.getRuntime().availableProcessors()) + " cores");
rows.add(row);
- row = new ArrayList<String>();
+ row = new ArrayList<>();
row.add("Locale");
- row.add(Locale.getDefault().toString() + "/" + System.getProperty("file.encoding"));
+ row.add(Locale.getDefault().toString() + "/"
+ + SystemPropertyConfigUtils.getSystemProperty(CommonConstants.SystemProperty.SYSTEM_FILE_ENCODING));
rows.add(row);
- row = new ArrayList<String>();
+ row = new ArrayList<>();
row.add("Uptime");
row.add(formatUptime(ManagementFactory.getRuntimeMXBean().getUptime()));
rows.add(row);
diff --cc dubbo-config/dubbo-config-spring/pom.xml
index a09bb6ab89,d054d5a9f0..0c14921e6e
--- a/dubbo-config/dubbo-config-spring/pom.xml
+++ b/dubbo-config/dubbo-config-spring/pom.xml
@@@ -74,9 -74,15 +74,9 @@@
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
- <version>1.9.21.2</version>
+ <version>1.9.22</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-monitor-default</artifactId>
- <version>${project.parent.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-rpc-dubbo</artifactId>
diff --cc dubbo-dependencies-bom/pom.xml
index 496c7ce9b4,61fd75e738..9a93a45ede
--- a/dubbo-dependencies-bom/pom.xml
+++ b/dubbo-dependencies-bom/pom.xml
@@@ -90,17 -90,17 +90,17 @@@
<properties>
<!-- Common libs -->
<!-- <spring_version>4.3.30.RELEASE</spring_version> -->
- <spring_version>5.3.25</spring_version>
- <spring_security_version>5.8.10</spring_security_version>
+ <spring_version>5.3.33</spring_version>
+ <spring_security_version>5.8.11</spring_security_version>
<javassist_version>3.30.2-GA</javassist_version>
- <byte-buddy_version>1.14.12</byte-buddy_version>
- <bytebuddy.version>1.14.13</bytebuddy.version>
++ <byte-buddy_version>1.14.13</byte-buddy_version>
<netty_version>3.2.10.Final</netty_version>
- <netty4_version>4.1.107.Final</netty4_version>
+ <netty4_version>4.1.108.Final</netty4_version>
<httpclient_version>4.5.14</httpclient_version>
<httpcore_version>4.4.16</httpcore_version>
<fastjson_version>1.2.83</fastjson_version>
- <fastjson2_version>2.0.47</fastjson2_version>
+ <fastjson2_version>2.0.48</fastjson2_version>
- <zookeeper_version>3.7.0</zookeeper_version>
+ <zookeeper_version>3.7.2</zookeeper_version>
<curator_version>5.1.0</curator_version>
<curator_test_version>2.12.0</curator_test_version>
<jedis_version>3.10.0</jedis_version>
@@@ -133,23 -132,19 +133,23 @@@
<rs_api_version>2.1.1</rs_api_version>
<resteasy_version>3.15.6.Final</resteasy_version>
<codehaus-jackson_version>1.9.13</codehaus-jackson_version>
- <tomcat_embed_version>8.5.99</tomcat_embed_version>
- <nacos_version>2.3.1</nacos_version>
+ <tomcat_embed_version>8.5.100</tomcat_embed_version>
+ <nacos_version>2.3.2</nacos_version>
+ <sentinel.version>1.8.6</sentinel.version>
+ <seata.version>1.6.1</seata.version>
- <grpc.version>1.62.2</grpc.version>
+ <grpc.version>1.63.0</grpc.version>
<grpc_contrib_verdion>0.8.1</grpc_contrib_verdion>
<jprotoc_version>1.2.2</jprotoc_version>
+ <mustache_version>0.9.10</mustache_version>
<!-- Log libs -->
<slf4j_version>1.7.36</slf4j_version>
- <jcl_version>1.3.0</jcl_version>
+ <jcl_version>1.3.1</jcl_version>
<log4j_version>1.2.17</log4j_version>
<logback_version>1.2.13</logback_version>
<!-- Fix the bug of log4j refer:https://github.com/apache/logging-log4j2/pull/608 -->
<log4j2_version>2.23.1</log4j2_version>
- <commons_io_version>2.15.1</commons_io_version>
+ <commons_io_version>2.16.0</commons_io_version>
+ <commons-codec_version>1.16.0</commons-codec_version>
<embedded_redis_version>0.13.0</embedded_redis_version>
diff --cc dubbo-distribution/dubbo-apache-release/pom.xml
index be51620299,1a1e30dc25..59fd737458
--- a/dubbo-distribution/dubbo-apache-release/pom.xml
+++ b/dubbo-distribution/dubbo-apache-release/pom.xml
@@@ -15,86 -14,87 +15,86 @@@
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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-distribution</artifactId>
- <version>${revision}</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>dubbo-apache-release</artifactId>
- <packaging>pom</packaging>
- <name>dubbo-apache-release</name>
- <description>The apache source release</description>
- <properties>
- <skip_maven_deploy>true</skip_maven_deploy>
- </properties>
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-distribution</artifactId>
+ <version>${revision}</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>dubbo-apache-release</artifactId>
+ <packaging>pom</packaging>
+ <name>dubbo-apache-release</name>
+ <description>The apache source release</description>
+ <properties>
+ <skip_maven_deploy>true</skip_maven_deploy>
+ </properties>
- <dependencies>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-demo-api-provider</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-demo-api-consumer</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-demo-api-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-demo-api-consumer</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
- <profiles>
- <profile>
- <id>release</id>
- <build>
- <finalName>apache-dubbo-${project.version}</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>3.7.1</version>
- <executions>
- <execution>
- <id>bin</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/bin-release.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- <execution>
- <id>src</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/assembly/source-release.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-gpg-plugin</artifactId>
- <version>1.6</version>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>sign</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ <profiles>
+ <profile>
+ <id>release</id>
+ <build>
+ <finalName>apache-dubbo-${project.version}</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
- <version>3.7.0</version>
++ <version>3.7.1</version>
+ <executions>
+ <execution>
+ <id>bin</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/bin-release.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>src</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/source-release.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.6</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ <phase>verify</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --cc dubbo-maven-plugin/pom.xml
index 6453eea5f4,e0ca5b99f4..59ebaedeff
--- a/dubbo-maven-plugin/pom.xml
+++ b/dubbo-maven-plugin/pom.xml
@@@ -68,29 -65,8 +68,29 @@@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>2.15.1</version>
+ <version>2.16.0</version>
</dependency>
+
+ <!-- Takes no effect for this dependency. To notify github dependencies bot to update ${protobuf-java.version} property. -->
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <version>${protobuf-java.version}</version>
+ <scope>test</scope>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.sonatype.plexus</groupId>
+ <artifactId>plexus-build-api</artifactId>
+ <version>0.0.7</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
<build>
diff --cc dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h12/AbstractServerCallListener.java
index 28a5a9fbf4,0000000000..42bb5fa435
mode 100644,000000..100644
--- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h12/AbstractServerCallListener.java
+++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h12/AbstractServerCallListener.java
@@@ -1,111 -1,0 +1,115 @@@
+/*
+ * 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.protocol.tri.h12;
+
+import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
+import org.apache.dubbo.common.logger.LoggerFactory;
+import org.apache.dubbo.common.stream.StreamObserver;
+import org.apache.dubbo.remoting.http12.exception.HttpRequestTimeout;
+import org.apache.dubbo.remoting.http12.h2.Http2CancelableStreamObserver;
+import org.apache.dubbo.rpc.Invoker;
+import org.apache.dubbo.rpc.Result;
+import org.apache.dubbo.rpc.RpcContext;
+import org.apache.dubbo.rpc.RpcInvocation;
+import org.apache.dubbo.rpc.protocol.tri.TripleHeaderEnum;
+
+import java.net.InetSocketAddress;
+
+import static org.apache.dubbo.common.constants.CommonConstants.REMOTE_APPLICATION_KEY;
+import static org.apache.dubbo.common.constants.LoggerCodeConstants.PROTOCOL_TIMEOUT_SERVER;
+import static org.apache.dubbo.rpc.protocol.tri.TripleConstant.REMOTE_ADDRESS_KEY;
+
+public abstract class AbstractServerCallListener implements ServerCallListener {
+
+ private static final ErrorTypeAwareLogger LOGGER =
+ LoggerFactory.getErrorTypeAwareLogger(AbstractServerCallListener.class);
+
+ protected final RpcInvocation invocation;
+
+ protected final Invoker<?> invoker;
+
+ protected final StreamObserver<Object> responseObserver;
+
+ public AbstractServerCallListener(
+ RpcInvocation invocation, Invoker<?> invoker, StreamObserver<Object> responseObserver) {
+ this.invocation = invocation;
+ this.invoker = invoker;
+ this.responseObserver = responseObserver;
+ }
+
+ public void invoke() {
+ if (responseObserver instanceof Http2CancelableStreamObserver) {
+ RpcContext.restoreCancellationContext(
+ ((Http2CancelableStreamObserver<Object>) responseObserver).getCancellationContext());
+ }
+ InetSocketAddress remoteAddress =
+ (InetSocketAddress) invocation.getAttributes().remove(REMOTE_ADDRESS_KEY);
+ RpcContext.getServiceContext().setRemoteAddress(remoteAddress);
+ String remoteApp = (String) invocation.getAttributes().remove(TripleHeaderEnum.CONSUMER_APP_NAME_KEY);
+ if (null != remoteApp) {
+ RpcContext.getServiceContext().setRemoteApplicationName(remoteApp);
+ invocation.setAttachmentIfAbsent(REMOTE_APPLICATION_KEY, remoteApp);
+ }
+ try {
+ final long stInMillis = System.currentTimeMillis();
+ final Result response = invoker.invoke(invocation);
++ if (response.hasException()) {
++ onResponseException(response.getException());
++ return;
++ }
+ response.whenCompleteWithContext((r, t) -> {
+ if (responseObserver instanceof AttachmentHolder) {
+ ((AttachmentHolder) responseObserver).setResponseAttachments(response.getObjectAttachments());
+ }
+ if (t != null) {
+ responseObserver.onError(t);
+ return;
+ }
- if (response.hasException()) {
- onResponseException(response.getException());
++ if (r.hasException()) {
++ onResponseException(r.getException());
+ return;
+ }
+ final long cost = System.currentTimeMillis() - stInMillis;
+ Long timeout = (Long) invocation.get("timeout");
+ if (timeout != null && timeout < cost) {
+ LOGGER.error(
+ PROTOCOL_TIMEOUT_SERVER,
+ "",
+ "",
+ String.format(
+ "Invoke timeout at server side, ignored to send response. service=%s method=%s cost=%s",
+ invocation.getTargetServiceUniqueName(), invocation.getMethodName(), cost));
+ HttpRequestTimeout serverSideTimeout = HttpRequestTimeout.serverSide();
+ responseObserver.onError(serverSideTimeout);
+ return;
+ }
+ onReturn(r.getValue());
+ });
+ } catch (Exception e) {
+ responseObserver.onError(e);
+ } finally {
+ RpcContext.removeCancellationContext();
+ RpcContext.removeContext();
+ }
+ }
+
+ protected void onResponseException(Throwable t) {
+ responseObserver.onError(t);
+ }
+
+ public abstract void onReturn(Object value);
+}
diff --cc dubbo-spring-boot/pom.xml
index a555e7b6b4,2276261aa4..3b7d665d03
--- a/dubbo-spring-boot/pom.xml
+++ b/dubbo-spring-boot/pom.xml
@@@ -40,9 -39,11 +40,9 @@@
<properties>
<spring-boot.version>2.7.18</spring-boot.version>
- <dubbo.version>${revision}</dubbo.version>
- <!-- Fix the bug of log4j refer:https://github.com/apache/logging-log4j2/pull/608 -->
- <log4j2_version>2.23.1</log4j2_version>
<!-- Spring boot buddy is lower than the delivery dependency package version and can only show the defined dependency version -->
- <byte-buddy.version>1.14.12</byte-buddy.version>
+ <byte-buddy.version>1.14.13</byte-buddy.version>
+ <mockito_version>4.11.0</mockito_version>
</properties>
<dependencyManagement>