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/05/24 02:09:39 UTC

(dubbo) branch 3.3 updated (6f1a41f125 -> 32f4cb53df)

This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a change to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git


    from 6f1a41f125 Http header verification is not required for h2c (#14231)
     add cd78bba7b7 Bump org.aspectj:aspectjweaver from 1.9.22 to 1.9.22.1 (#14181)
     add 80b145db3e Bump org.testcontainers:testcontainers from 1.19.7 to 1.19.8 (#14183)
     add 4cd9a98395 Bump net.bytebuddy:byte-buddy from 1.14.14 to 1.14.15 (#14184)
     add 9968834e62 Bump bytebuddy.version from 1.14.14 to 1.14.15 (#14179)
     add faabbf6435 Bump io.micrometer:micrometer-core from 1.12.5 to 1.13.0 (#14219)
     add 43ae6a7aba Bump commons-logging:commons-logging from 1.3.1 to 1.3.2 (#14215)
     add a6187b8e93 Bump org.codehaus.mojo:build-helper-maven-plugin from 3.5.0 to 3.6.0 (#14214)
     add d64fbf8b94 Bump grpc.version from 1.63.0 to 1.64.0 (#14213)
     add b867f9ebd7 Bump spring_version from 5.3.34 to 5.3.35 (#14211)
     add 75f0eb4a15 Bump io.projectreactor:reactor-core from 3.6.5 to 3.6.6 (#14212)
     add 57b87029a6 Bump org.graalvm.buildtools:native-maven-plugin from 0.10.1 to 0.10.2 (#14217)
     add e21244a431 check whether property name is safe based on the last fragment kebab-case comparison (#14208)
     add 189d76be5d check child is json or not in zookeeper.it will be continue if not. (#14166)
     add cc95b52dfb Com.google.code.gson gson 2.11.0 (#14224)
     add b12b23cbf0 fix: not initialize MetricsReporter  if not support prometheus (#14225)
     add a6c61175c5 fix:embedded-redis need update version to run on macos Sonoma (#14072) (#14074) (#14227)
     add 23599941e7 :arrow_up: upgrade micrometer to 1.13 (#14228)
     new 32f4cb53df Merge branch 'apache-3.2' into apache-3.3

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../dubbo/common/config/ConfigurationUtils.java    | 24 +++++++-----
 .../org/apache/dubbo/common/json/JsonUtil.java     |  2 +
 .../dubbo/common/json/impl/FastJson2Impl.java      |  7 ++++
 .../dubbo/common/json/impl/FastJsonImpl.java       | 10 +++++
 .../apache/dubbo/common/json/impl/GsonImpl.java    | 13 +++++++
 .../apache/dubbo/common/json/impl/JacksonImpl.java | 12 ++++++
 .../org/apache/dubbo/common/utils/JsonUtils.java   |  4 ++
 .../common/extension/ExtensionDirectorTest.java    |  3 +-
 .../apache/dubbo/common/json/GsonUtilsTest.java    |  3 +-
 .../apache/dubbo/common/utils/JsonUtilsTest.java   | 43 ++++++++++++++++++++++
 dubbo-config/dubbo-config-api/pom.xml              |  2 +-
 .../config/deploy/DefaultApplicationDeployer.java  |  3 ++
 .../deploy/DefaultApplicationDeployerTest.java     | 12 ++++++
 dubbo-config/dubbo-config-spring/pom.xml           |  2 +-
 .../dubbo-demo-native-consumer/pom.xml             |  2 +-
 .../dubbo-demo-native-provider/pom.xml             |  2 +-
 dubbo-demo/dubbo-demo-spring-boot/pom.xml          |  2 +-
 dubbo-dependencies-bom/pom.xml                     | 16 ++++----
 dubbo-metrics/dubbo-metrics-prometheus/pom.xml     |  2 +-
 .../registry/zookeeper/ZookeeperRegistry.java      | 12 +++++-
 .../observability/autoconfigure/pom.xml            |  2 +-
 .../observability/pom.xml                          |  2 +-
 dubbo-spring-boot/pom.xml                          |  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                                            |  2 +-
 27 files changed, 155 insertions(+), 35 deletions(-)


(dubbo) 01/01: Merge branch 'apache-3.2' into apache-3.3

Posted by al...@apache.org.
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 32f4cb53df24b59af3ee6931d2d51a93b2f9dd1f
Merge: 6f1a41f125 23599941e7
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Fri May 24 10:01:37 2024 +0800

    Merge branch 'apache-3.2' into apache-3.3
    
    # Conflicts:
    #       dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/FastJson2Impl.java
    #       dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployerTest.java
    #       dubbo-dependencies-bom/pom.xml
    #       dubbo-spring-boot/pom.xml
    #       dubbo-test/dubbo-test-spring/pom.xml

 .../dubbo/common/config/ConfigurationUtils.java    | 24 +++++++-----
 .../org/apache/dubbo/common/json/JsonUtil.java     |  2 +
 .../dubbo/common/json/impl/FastJson2Impl.java      |  7 ++++
 .../dubbo/common/json/impl/FastJsonImpl.java       | 10 +++++
 .../apache/dubbo/common/json/impl/GsonImpl.java    | 13 +++++++
 .../apache/dubbo/common/json/impl/JacksonImpl.java | 12 ++++++
 .../org/apache/dubbo/common/utils/JsonUtils.java   |  4 ++
 .../common/extension/ExtensionDirectorTest.java    |  3 +-
 .../apache/dubbo/common/json/GsonUtilsTest.java    |  3 +-
 .../apache/dubbo/common/utils/JsonUtilsTest.java   | 43 ++++++++++++++++++++++
 dubbo-config/dubbo-config-api/pom.xml              |  2 +-
 .../config/deploy/DefaultApplicationDeployer.java  |  3 ++
 .../deploy/DefaultApplicationDeployerTest.java     | 12 ++++++
 dubbo-config/dubbo-config-spring/pom.xml           |  2 +-
 .../dubbo-demo-native-consumer/pom.xml             |  2 +-
 .../dubbo-demo-native-provider/pom.xml             |  2 +-
 dubbo-demo/dubbo-demo-spring-boot/pom.xml          |  2 +-
 dubbo-dependencies-bom/pom.xml                     | 16 ++++----
 dubbo-metrics/dubbo-metrics-prometheus/pom.xml     |  2 +-
 .../registry/zookeeper/ZookeeperRegistry.java      | 12 +++++-
 .../observability/autoconfigure/pom.xml            |  2 +-
 .../observability/pom.xml                          |  2 +-
 dubbo-spring-boot/pom.xml                          |  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                                            |  2 +-
 27 files changed, 155 insertions(+), 35 deletions(-)

diff --cc dubbo-common/src/main/java/org/apache/dubbo/common/json/JsonUtil.java
index b03092ab7a,0000000000..555792abca
mode 100644,000000..100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/json/JsonUtil.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/json/JsonUtil.java
@@@ -1,58 -1,0 +1,60 @@@
 +/*
 + * 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.common.json;
 +
 +import org.apache.dubbo.common.extension.SPI;
 +
 +import java.lang.reflect.Type;
 +import java.util.List;
 +import java.util.Map;
 +
 +@SPI
 +public interface JsonUtil {
 +    boolean isSupport();
 +
++    boolean isJson(String json);
++
 +    <T> T toJavaObject(String json, Type type);
 +
 +    <T> List<T> toJavaList(String json, Class<T> clazz);
 +
 +    String toJson(Object obj);
 +
 +    List<?> getList(Map<String, ?> obj, String key);
 +
 +    List<Map<String, ?>> getListOfObjects(Map<String, ?> obj, String key);
 +
 +    List<String> getListOfStrings(Map<String, ?> obj, String key);
 +
 +    Map<String, ?> getObject(Map<String, ?> obj, String key);
 +
 +    Object convertObject(Object obj, Type type);
 +
 +    Object convertObject(Object obj, Class<?> clazz);
 +
 +    Double getNumberAsDouble(Map<String, ?> obj, String key);
 +
 +    Integer getNumberAsInteger(Map<String, ?> obj, String key);
 +
 +    Long getNumberAsLong(Map<String, ?> obj, String key);
 +
 +    String getString(Map<String, ?> obj, String key);
 +
 +    List<Map<String, ?>> checkObjectList(List<?> rawList);
 +
 +    List<String> checkStringList(List<?> rawList);
 +}
diff --cc dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/FastJson2Impl.java
index 09c795bb6e,ed0cca1d81..fb5dfa1d59
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/FastJson2Impl.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/FastJson2Impl.java
@@@ -19,9 -19,17 +19,16 @@@ package org.apache.dubbo.common.json.im
  import java.lang.reflect.Type;
  import java.util.List;
  
+ import com.alibaba.fastjson2.JSONValidator;
  import com.alibaba.fastjson2.JSONWriter;
  
 -public class FastJson2Impl extends AbstractJSONImpl {
 +public class FastJson2Impl extends AbstractJsonUtilImpl {
+ 
+     @Override
+     public boolean isJson(String json) {
+         JSONValidator validator = JSONValidator.from(json);
+         return validator.validate();
+     }
 -
      @Override
      public <T> T toJavaObject(String json, Type type) {
          return com.alibaba.fastjson2.JSON.parseObject(json, type);
diff --cc dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/FastJsonImpl.java
index a44291cc6e,30d74d47a6..f314648469
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/FastJsonImpl.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/FastJsonImpl.java
@@@ -19,11 -19,20 +19,21 @@@ package org.apache.dubbo.common.json.im
  import java.lang.reflect.Type;
  import java.util.List;
  
 +import com.alibaba.fastjson.parser.ParserConfig;
  import com.alibaba.fastjson.serializer.SerializerFeature;
  
 -public class FastJsonImpl extends AbstractJSONImpl {
 +public class FastJsonImpl extends AbstractJsonUtilImpl {
  
+     @Override
+     public boolean isJson(String json) {
+         try {
+             Object obj = com.alibaba.fastjson.JSON.parse(json);
+             return obj instanceof com.alibaba.fastjson.JSONObject || obj instanceof com.alibaba.fastjson.JSONArray;
+         } catch (com.alibaba.fastjson.JSONException e) {
+             return false;
+         }
+     }
+ 
      @Override
      public <T> T toJavaObject(String json, Type type) {
          return com.alibaba.fastjson.JSON.parseObject(json, type);
diff --cc dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/GsonImpl.java
index 39586cb19e,da79d9e91a..f514295c0a
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/GsonImpl.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/json/impl/GsonImpl.java
@@@ -20,9 -20,12 +20,12 @@@ import java.lang.reflect.Type
  import java.util.List;
  
  import com.google.gson.Gson;
+ import com.google.gson.JsonElement;
+ import com.google.gson.JsonParser;
+ import com.google.gson.JsonSyntaxException;
  import com.google.gson.reflect.TypeToken;
  
 -public class GsonImpl extends AbstractJSONImpl {
 +public class GsonImpl extends AbstractJsonUtilImpl {
      // weak reference of com.google.gson.Gson, prevent throw exception when init
      private volatile Object gsonCache = null;
  
diff --cc dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java
index 5d7a0c5b99,820cb1e4d7..6c1e8adb00
--- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java
+++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java
@@@ -389,9 -382,11 +389,12 @@@ public class DefaultApplicationDeploye
          Optional<MetricsConfig> configOptional = configManager.getMetrics();
          // If no specific metrics type is configured and there is no Prometheus dependency in the dependencies.
          MetricsConfig metricsConfig = configOptional.orElse(new MetricsConfig(applicationModel));
+         if (PROTOCOL_PROMETHEUS.equals(metricsConfig.getProtocol()) && !isSupportPrometheus()) {
+             return;
+         }
          if (StringUtils.isBlank(metricsConfig.getProtocol())) {
 -            metricsConfig.setProtocol(isSupportPrometheus() ? PROTOCOL_PROMETHEUS : PROTOCOL_DEFAULT);
 +            metricsConfig.setProtocol(
 +                    MetricsSupportUtil.isSupportPrometheus() ? PROTOCOL_PROMETHEUS : PROTOCOL_DEFAULT);
          }
          collector.setCollectEnabled(true);
          collector.collectApplication();
diff --cc dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployerTest.java
index a4ac9c59d8,1cd39c7da8..c205d7ce8d
--- a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployerTest.java
+++ b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployerTest.java
@@@ -17,7 -17,8 +17,8 @@@
  package org.apache.dubbo.config.deploy;
  
  import org.apache.dubbo.common.utils.Assert;
+ import org.apache.dubbo.config.MetricsConfig;
 -import org.apache.dubbo.rpc.model.ApplicationModel;
 +import org.apache.dubbo.metrics.utils.MetricsSupportUtil;
  
  import org.junit.jupiter.api.Test;
  
@@@ -25,7 -28,17 +28,16 @@@ class DefaultApplicationDeployerTest 
  
      @Test
      void isSupportPrometheus() {
 -        boolean supportPrometheus =
 -                new DefaultApplicationDeployer(ApplicationModel.defaultModel()).isSupportPrometheus();
 -        Assert.assertTrue(supportPrometheus, "DefaultApplicationDeployer.isSupportPrometheus() should return true");
 +        boolean supportPrometheus = MetricsSupportUtil.isSupportPrometheus();
 +        Assert.assertTrue(supportPrometheus, "MetricsSupportUtil.isSupportPrometheus() should return true");
      }
+ 
+     @Test
+     void isImportPrometheus() {
+         MetricsConfig metricsConfig = new MetricsConfig();
+         metricsConfig.setProtocol("prometheus");
+         boolean importPrometheus = PROTOCOL_PROMETHEUS.equals(metricsConfig.getProtocol())
+                 && !DefaultApplicationDeployer.isSupportPrometheus();
+         Assert.assertTrue(!importPrometheus, " should return false");
+     }
  }
diff --cc dubbo-config/dubbo-config-spring/pom.xml
index b49df8dc0c,425b2bba3d..9d9a134603
--- 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.22</version>
+       <version>1.9.22.1</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-demo/dubbo-demo-spring-boot/pom.xml
index 9e43674d89,1472ada8ae..5466f619f8
--- a/dubbo-demo/dubbo-demo-spring-boot/pom.xml
+++ b/dubbo-demo/dubbo-demo-spring-boot/pom.xml
@@@ -35,9 -35,10 +35,9 @@@
      <skip_maven_deploy>true</skip_maven_deploy>
      <spring-boot.version>2.7.18</spring-boot.version>
      <spring-boot-maven-plugin.version>2.7.18</spring-boot-maven-plugin.version>
-     <micrometer-core.version>1.12.5</micrometer-core.version>
+     <micrometer-core.version>1.13.0</micrometer-core.version>
    </properties>
 +
    <dependencyManagement>
      <dependencies>
        <dependency>
diff --cc dubbo-dependencies-bom/pom.xml
index d538054c7b,7da866f6c0..e5ca806fb7
--- a/dubbo-dependencies-bom/pom.xml
+++ b/dubbo-dependencies-bom/pom.xml
@@@ -90,10 -90,10 +90,10 @@@
    <properties>
      <!-- Common libs -->
      <!-- <spring_version>4.3.30.RELEASE</spring_version> -->
-     <spring_version>5.3.34</spring_version>
+     <spring_version>5.3.35</spring_version>
      <spring_security_version>5.8.12</spring_security_version>
      <javassist_version>3.30.2-GA</javassist_version>
-     <byte-buddy_version>1.14.14</byte-buddy_version>
 -    <bytebuddy.version>1.14.15</bytebuddy.version>
++    <byte-buddy_version>1.14.15</byte-buddy_version>
      <netty_version>3.2.10.Final</netty_version>
      <netty4_version>4.1.109.Final</netty4_version>
      <httpclient_version>4.5.14</httpclient_version>
@@@ -119,9 -119,8 +119,9 @@@
      <snakeyaml_version>2.2</snakeyaml_version>
      <commons_lang3_version>3.14.0</commons_lang3_version>
      <envoy_api_version>0.1.35</envoy_api_version>
-     <micrometer.version>1.12.5</micrometer.version>
+     <micrometer.version>1.13.0</micrometer.version>
 -
 +    <opentelemetry.version>1.26.0</opentelemetry.version>
 +    <zipkin-reporter.version>2.16.4</zipkin-reporter.version>
      <micrometer-tracing.version>1.2.5</micrometer-tracing.version>
      <t_digest.version>3.3</t_digest.version>
      <prometheus_client.version>0.16.0</prometheus_client.version>
@@@ -135,15 -134,12 +135,15 @@@
      <codehaus-jackson_version>1.9.13</codehaus-jackson_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.63.0</grpc.version>
+     <grpc.version>1.64.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.1</jcl_version>
+     <jcl_version>1.3.2</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 -->
@@@ -156,25 -151,16 +156,25 @@@
      <!-- Alibaba -->
      <alibaba_spring_context_support_version>1.0.11</alibaba_spring_context_support_version>
  
 +    <!-- Test libs -->
 +    <junit_jupiter_version>5.9.3</junit_jupiter_version>
 +    <junit_version>4.13.2</junit_version>
 +    <awaitility_version>4.2.0</awaitility_version>
 +    <hamcrest_version>2.2</hamcrest_version>
 +    <cglib_version>2.2.2</cglib_version>
 +    <mockito_version>4.11.0</mockito_version>
 +
      <jaxb_version>2.2.7</jaxb_version>
      <activation_version>1.2.0</activation_version>
-     <test_container_version>1.19.7</test_container_version>
+     <test_container_version>1.19.8</test_container_version>
 -    <hessian_lite_version>3.2.13</hessian_lite_version>
 +    <hessian_lite_version>4.0.0</hessian_lite_version>
      <swagger_version>1.6.14</swagger_version>
  
      <snappy_java_version>1.1.10.5</snappy_java_version>
      <bouncycastle-bcprov_version>1.70</bouncycastle-bcprov_version>
 +    <sofa_registry_version>5.4.3</sofa_registry_version>
      <metrics_version>2.0.6</metrics_version>
-     <gson_version>2.10.1</gson_version>
+     <gson_version>2.11.0</gson_version>
      <jackson_version>2.17.1</jackson_version>
      <mortbay_jetty_version>6.1.26</mortbay_jetty_version>
      <portlet_version>2.0</portlet_version>
diff --cc dubbo-spring-boot/pom.xml
index ba3a5e4cd5,807bcd9b81..d198c79489
--- 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.14</byte-buddy.version>
+     <byte-buddy.version>1.14.15</byte-buddy.version>
 +    <mockito_version>4.11.0</mockito_version>
    </properties>
  
    <dependencyManagement>