Skip to content

Commit

Permalink
Merge branch 'apache-3.2' into apache-3.3
Browse files Browse the repository at this point in the history
# Conflicts:
#	dubbo-build-tools/pom.xml
#	dubbo-dependencies-bom/pom.xml
#	dubbo-dependencies/dubbo-dependencies-zookeeper-curator5/pom.xml
#	dubbo-kubernetes/pom.xml
#	dubbo-native-plugin/pom.xml
#	dubbo-xds/pom.xml
#	dubbo-xds/src/test/java/org/apache/dubbo/rpc/cluster/router/xds/XdsRouteTest.java
#	pom.xml
  • Loading branch information
AlbumenJ committed Dec 14, 2023
2 parents ad803e1 + 33677c0 commit 0fccd2c
Show file tree
Hide file tree
Showing 111 changed files with 223 additions and 7,615 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.registry.xds.util;
package org.apache.dubbo.common.serialization;

import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse;

public interface XdsListener {
void process(DiscoveryResponse discoveryResponse);
public interface PreferSerializationProvider {
String getPreferSerialization();
}
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.common.serialization.PreferSerializationProvider;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.config.support.Parameter;
Expand All @@ -30,7 +31,6 @@
import static org.apache.dubbo.common.constants.CommonConstants.SSL_ENABLED_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.THREAD_POOL_EXHAUSTED_LISTENERS_KEY;
import static org.apache.dubbo.common.constants.LoggerCodeConstants.COMMON_UNEXPECTED_EXCEPTION;
import static org.apache.dubbo.common.constants.ProviderConstants.DEFAULT_PREFER_SERIALIZATION;

/**
* Configuration for the protocol.
Expand Down Expand Up @@ -270,7 +270,12 @@ protected void checkDefault() {
}

if (StringUtils.isBlank(preferSerialization)) {
preferSerialization = serialization != null ? serialization : DEFAULT_PREFER_SERIALIZATION;
preferSerialization = serialization != null
? serialization
: getScopeModel()
.getBeanFactory()
.getBean(PreferSerializationProvider.class)
.getPreferSerialization();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.dubbo.config.context;

import org.apache.dubbo.common.serialization.PreferSerializationProvider;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ConfigCenterConfig;
Expand All @@ -27,6 +28,7 @@
import org.apache.dubbo.config.ProviderConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.rpc.model.ApplicationModel;
import org.apache.dubbo.rpc.model.FrameworkModel;

import java.util.Collection;
import java.util.Optional;
Expand Down Expand Up @@ -64,6 +66,7 @@ public void init() {
ApplicationModel applicationModel = ApplicationModel.defaultModel();
configManager = applicationModel.getApplicationConfigManager();
moduleConfigManager = applicationModel.getDefaultModule().getConfigManager();
FrameworkModel.defaultModel().getBeanFactory().registerBean(TestPreferSerializationProvider.class);
}

@Test
Expand Down Expand Up @@ -474,4 +477,11 @@ void testLoadConfig() {
Assertions.assertFalse(moduleConfigManager.getProviders().isEmpty());
Assertions.assertFalse(moduleConfigManager.getConsumers().isEmpty());
}

public static class TestPreferSerializationProvider implements PreferSerializationProvider {
@Override
public String getPreferSerialization() {
return "fastjson2,hessian2";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@

import com.alibaba.dubbo.config.ReferenceConfig;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

class GenericServiceTest {

@BeforeEach
public void beforeEach() {
@BeforeAll
public static void beforeAll() {
DubboBootstrap.reset();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.apache.dubbo.common.constants.ProviderConstants.DEFAULT_PREFER_SERIALIZATION;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasEntry;
Expand All @@ -43,6 +42,7 @@ class ProtocolConfigTest {
@BeforeEach
public void setUp() {
DubboBootstrap.reset();
// FrameworkModel.defaultModel().getBeanFactory().registerBean(TestPreferSerializationProvider.class);
}

@AfterEach
Expand Down Expand Up @@ -389,7 +389,7 @@ void testPreferSerializationDefault1() throws Exception {
assertNull(protocolConfig.getPreferSerialization());

protocolConfig.checkDefault();
assertThat(protocolConfig.getPreferSerialization(), equalTo(DEFAULT_PREFER_SERIALIZATION));
assertThat(protocolConfig.getPreferSerialization(), equalTo("fastjson2,hessian2"));

protocolConfig = new ProtocolConfig();
protocolConfig.setSerialization("x-serialization");
Expand All @@ -405,7 +405,7 @@ void testPreferSerializationDefault2() throws Exception {
assertNull(protocolConfig.getPreferSerialization());

protocolConfig.refresh();
assertThat(protocolConfig.getPreferSerialization(), equalTo(DEFAULT_PREFER_SERIALIZATION));
assertThat(protocolConfig.getPreferSerialization(), equalTo("fastjson2,hessian2"));

protocolConfig = new ProtocolConfig();
protocolConfig.setSerialization("x-serialization");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.registry.xds;
package org.apache.dubbo.config.utils;

public final class XdsInitializationException extends Exception {
import org.apache.dubbo.common.serialization.PreferSerializationProvider;

public XdsInitializationException(String message) {
super(message);
}

public XdsInitializationException(String message, Throwable cause) {
super(message, cause);
public class TestPreferSerializationProvider implements PreferSerializationProvider {
@Override
public String getPreferSerialization() {
return "fastjson2,hessian2";
}
}
2 changes: 1 addition & 1 deletion dubbo-configcenter/dubbo-configcenter-apollo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<description>The Apollo implementation of the configcenter api</description>
<properties>
<skip_maven_deploy>false</skip_maven_deploy>
<apollo_mock_server_version>2.1.0</apollo_mock_server_version>
<apollo_mock_server_version>2.2.0</apollo_mock_server_version>
</properties>

<dependencies>
Expand Down
16 changes: 8 additions & 8 deletions dubbo-dependencies-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<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.42</fastjson2_version>
<fastjson2_version>2.0.43</fastjson2_version>
<zookeeper_version>3.7.2</zookeeper_version>
<curator_version>5.1.0</curator_version>
<curator_test_version>2.12.0</curator_test_version>
Expand All @@ -110,7 +110,7 @@
<consul_process_version>2.2.1</consul_process_version>
<consul_client_version>1.5.3</consul_client_version>
<xmemcached_version>1.4.3</xmemcached_version>
<cxf_version>3.5.5</cxf_version>
<cxf_version>3.6.2</cxf_version>
<thrift_version>0.19.0</thrift_version>
<hessian_version>4.0.66</hessian_version>
<protobuf-java_version>3.25.1</protobuf-java_version>
Expand All @@ -126,10 +126,10 @@
<kryo_version>4.0.3</kryo_version>
<kryo_serializers_version>0.45</kryo_serializers_version>
<fst_version>2.57</fst_version>
<avro_version>1.11.1</avro_version>
<avro_version>1.11.3</avro_version>
<apollo_client_version>2.1.0</apollo_client_version>
<snakeyaml_version>2.2</snakeyaml_version>
<commons_lang3_version>3.12.0</commons_lang3_version>
<commons_lang3_version>3.14.0</commons_lang3_version>
<protostuff_version>1.8.0</protostuff_version>
<envoy_api_version>0.1.35</envoy_api_version>
<micrometer.version>1.12.0</micrometer.version>
Expand All @@ -146,12 +146,12 @@
<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.87</tomcat_embed_version>
<tomcat_embed_version>8.5.96</tomcat_embed_version>
<jetcd_version>0.7.6</jetcd_version>
<nacos_version>2.2.4</nacos_version>
<sentinel.version>1.8.6</sentinel.version>
<seata.version>1.6.1</seata.version>
<grpc.version>1.59.0</grpc.version>
<grpc.version>1.60.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>
Expand Down Expand Up @@ -200,8 +200,8 @@
<mortbay_jetty_version>6.1.26</mortbay_jetty_version>
<portlet_version>2.0</portlet_version>
<maven_flatten_version>1.5.0</maven_flatten_version>
<commons_compress_version>1.23.0</commons_compress_version>
<spotless-maven-plugin.version>2.41.0</spotless-maven-plugin.version>
<commons_compress_version>1.25.0</commons_compress_version>
<spotless-maven-plugin.version>2.41.1</spotless-maven-plugin.version>
<spotless.action>check</spotless.action>
<dubbo-shared-resources.version>1.0.0</dubbo-shared-resources.version>
<palantirJavaFormat.version>2.38.0</palantirJavaFormat.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<slf4j_version>1.7.36</slf4j_version>
<curator5_version>5.1.0</curator5_version>
<zookeeper_version>3.8.3</zookeeper_version>
<spotless-maven-plugin.version>2.41.0</spotless-maven-plugin.version>
<spotless-maven-plugin.version>2.41.1</spotless-maven-plugin.version>
<spotless.action>check</spotless.action>
<dubbo-shared-resources.version>1.0.0</dubbo-shared-resources.version>
<palantirJavaFormat.version>2.38.0</palantirJavaFormat.version>
Expand Down
2 changes: 1 addition & 1 deletion dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<slf4j_version>1.7.36</slf4j_version>
<curator_version>4.3.0</curator_version>
<zookeeper_version>3.4.14</zookeeper_version>
<spotless-maven-plugin.version>2.41.0</spotless-maven-plugin.version>
<spotless-maven-plugin.version>2.41.1</spotless-maven-plugin.version>
<spotless.action>check</spotless.action>
<dubbo-shared-resources.version>1.0.0</dubbo-shared-resources.version>
<palantirJavaFormat.version>2.38.0</palantirJavaFormat.version>
Expand Down
2 changes: 1 addition & 1 deletion dubbo-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</modules>

<properties>
<spotless-maven-plugin.version>2.41.0</spotless-maven-plugin.version>
<spotless-maven-plugin.version>2.41.1</spotless-maven-plugin.version>
<spotless.action>check</spotless.action>
<dubbo-shared-resources.version>1.0.0</dubbo-shared-resources.version>
<palantirJavaFormat.version>2.38.0</palantirJavaFormat.version>
Expand Down
23 changes: 0 additions & 23 deletions dubbo-distribution/dubbo-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,6 @@
<optional>true</optional>
</dependency>

<!-- kubernetes -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-kubernetes</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

<!-- metadata -->
<dependency>
<groupId>org.apache.dubbo</groupId>
Expand Down Expand Up @@ -591,15 +582,6 @@
<optional>true</optional>
</dependency>

<!-- xds -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-xds</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

<!-- Transitive dependencies -->
<dependency>
<groupId>org.springframework</groupId>
Expand Down Expand Up @@ -718,8 +700,6 @@
<include>org.apache.dubbo:dubbo-serialization-hessian2</include>
<include>org.apache.dubbo:dubbo-serialization-fastjson2</include>
<include>org.apache.dubbo:dubbo-serialization-jdk</include>
<include>org.apache.dubbo:dubbo-kubernetes</include>
<include>org.apache.dubbo:dubbo-xds</include>
</includes>
</artifactSet>
<transformers>
Expand Down Expand Up @@ -911,9 +891,6 @@
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.registry.integration.RegistryProtocolListener</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.registry.xds.XdsCertificateSigner</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/dubbo/internal/org.apache.dubbo.rpc.protocol.rest.filter.RestResponseInterceptor</resource>
</transformer>
Expand Down
2 changes: 1 addition & 1 deletion dubbo-distribution/dubbo-apache-release/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.5.0</version>
<version>3.6.0</version>
<executions>
<execution>
<id>bin</id>
Expand Down
13 changes: 0 additions & 13 deletions dubbo-distribution/dubbo-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,6 @@
<version>${project.version}</version>
</dependency>

<!-- kubernetes -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-kubernetes</artifactId>
<version>${project.version}</version>
</dependency>

<!-- metadata -->
<dependency>
<groupId>org.apache.dubbo</groupId>
Expand Down Expand Up @@ -741,12 +734,6 @@
<version>${project.version}</version>
</dependency>

<!-- xds -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-xds</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
6 changes: 0 additions & 6 deletions dubbo-distribution/dubbo-core-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,6 @@
META-INF/dubbo/internal/org.apache.dubbo.registry.integration.RegistryProtocolListener
</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>
META-INF/dubbo/internal/org.apache.dubbo.registry.xds.XdsCertificateSigner
</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>
Expand Down
2 changes: 1 addition & 1 deletion dubbo-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<packaging>pom</packaging>

<properties>
<spotless-maven-plugin.version>2.41.0</spotless-maven-plugin.version>
<spotless-maven-plugin.version>2.41.1</spotless-maven-plugin.version>
<spotless.action>check</spotless.action>
<dubbo-shared-resources.version>1.0.0</dubbo-shared-resources.version>
<palantirJavaFormat.version>2.38.0</palantirJavaFormat.version>
Expand Down
Loading

0 comments on commit 0fccd2c

Please sign in to comment.