From 499aa7acfaf9443d3419d64209f3e1170b166789 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 01:27:25 +0800 Subject: [PATCH] Bump org.redisson:redisson from 3.17.3 to 3.30.0 (#4924) * Bump org.redisson:redisson from 3.17.3 to 3.30.0 Bumps [org.redisson:redisson](https://github.com/redisson/redisson) from 3.17.3 to 3.30.0. - [Release notes](https://github.com/redisson/redisson/releases) - [Changelog](https://github.com/redisson/redisson/blob/master/CHANGELOG.md) - [Commits](https://github.com/redisson/redisson/compare/redisson-3.17.3...redisson-3.30.0) --- updated-dependencies: - dependency-name: org.redisson:redisson dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * manual upgrade * Update dependency that are no longer maintained * Streamline build command * Fix address in use and try to fix countDownLatch await blocking * Update deprecated ENV --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pil0tXia --- .github/workflows/ci.yml | 10 +++++---- .github/workflows/code-scanning.yml | 2 +- .../eventmesh-connector-redis/build.gradle | 2 +- .../eventmesh-storage-redis/build.gradle | 14 +++--------- .../eventmesh-storage-redis/gradle.properties | 1 + .../storage/redis/client/RedissonClient.java | 13 +++++------ .../storage/redis/config/RedisProperties.java | 11 +++++----- .../main/resources/redis-client.properties | 6 ++++- .../storage/redis/AbstractRedisServer.java | 22 +++++++------------ .../redis/config/RedisPropertiesTest.java | 10 ++------- 10 files changed, 38 insertions(+), 53 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce5eae95b7..2d86da1f51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: - name: GenerateGrammarSource run: ./gradlew clean generateGrammarSource --parallel --daemon --scan env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} + DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v4 @@ -69,14 +69,16 @@ jobs: # https://docs.gradle.org/current/userguide/performance.html - name: Build - run: ./gradlew clean build dist jacocoTestReport -x spotlessJava -x generateGrammarSource --parallel --daemon --scan + run: > + ./gradlew clean build dist jacocoTestReport --parallel --daemon --scan + -x spotlessJava -x generateGrammarSource -x generateDistLicense -x checkDeniedLicense env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} + DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} - name: Install plugin run: ./gradlew installPlugin --scan env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} + DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} - name: Upload coverage report to codecov.io run: bash <(curl -s https://codecov.io/bash) || echo 'Failed to upload coverage report!' diff --git a/.github/workflows/code-scanning.yml b/.github/workflows/code-scanning.yml index 0a7b2ecb28..df3e57c89e 100644 --- a/.github/workflows/code-scanning.yml +++ b/.github/workflows/code-scanning.yml @@ -68,7 +68,7 @@ jobs: if: matrix.language == 'java' run: ./gradlew clean assemble compileTestJava --parallel --daemon --scan env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} + DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }} - name: Perform CodeQL analysis uses: github/codeql-action/analyze@v3 diff --git a/eventmesh-connectors/eventmesh-connector-redis/build.gradle b/eventmesh-connectors/eventmesh-connector-redis/build.gradle index 3cf01f264e..d5ca8273e3 100644 --- a/eventmesh-connectors/eventmesh-connector-redis/build.gradle +++ b/eventmesh-connectors/eventmesh-connector-redis/build.gradle @@ -19,7 +19,7 @@ dependencies { implementation project(":eventmesh-common") implementation project(":eventmesh-openconnect:eventmesh-openconnect-java") - implementation 'org.redisson:redisson:3.17.3' + implementation 'org.redisson:redisson:3.30.0' api 'io.cloudevents:cloudevents-json-jackson' diff --git a/eventmesh-storage-plugin/eventmesh-storage-redis/build.gradle b/eventmesh-storage-plugin/eventmesh-storage-redis/build.gradle index bec0767638..06b6827c6c 100644 --- a/eventmesh-storage-plugin/eventmesh-storage-redis/build.gradle +++ b/eventmesh-storage-plugin/eventmesh-storage-redis/build.gradle @@ -20,24 +20,16 @@ dependencies { implementation project(":eventmesh-storage-plugin:eventmesh-storage-api") // redisson - implementation('org.redisson:redisson:3.17.3') { - exclude group: 'io.netty', module: 'netty-common' - exclude group: 'io.netty', module: 'netty-buffer' - exclude group: 'io.netty', module: 'netty-codec' - exclude group: 'io.netty', module: 'netty-transport' - exclude group: 'io.netty', module: 'netty-resolver' - exclude group: 'io.netty', module: 'netty-resolver-dns' - exclude group: 'io.netty', module: 'netty-handler' - } + implementation 'org.redisson:redisson:3.30.0' // netty - implementation "io.netty:netty-all" + implementation 'io.netty:netty-all' // auxiliary serialize api 'io.cloudevents:cloudevents-json-jackson' // test dependencies - testImplementation 'ai.grakn:redis-mock:0.1.6' + testImplementation 'com.github.fppt:jedis-mock:1.1.1' testImplementation "org.mockito:mockito-core" compileOnly 'org.projectlombok:lombok' diff --git a/eventmesh-storage-plugin/eventmesh-storage-redis/gradle.properties b/eventmesh-storage-plugin/eventmesh-storage-redis/gradle.properties index 899c915a54..6f2a7b3f8b 100644 --- a/eventmesh-storage-plugin/eventmesh-storage-redis/gradle.properties +++ b/eventmesh-storage-plugin/eventmesh-storage-redis/gradle.properties @@ -1,3 +1,4 @@ +# # 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. diff --git a/eventmesh-storage-plugin/eventmesh-storage-redis/src/main/java/org/apache/eventmesh/storage/redis/client/RedissonClient.java b/eventmesh-storage-plugin/eventmesh-storage-redis/src/main/java/org/apache/eventmesh/storage/redis/client/RedissonClient.java index 69fb37b922..9a02064747 100644 --- a/eventmesh-storage-plugin/eventmesh-storage-redis/src/main/java/org/apache/eventmesh/storage/redis/client/RedissonClient.java +++ b/eventmesh-storage-plugin/eventmesh-storage-redis/src/main/java/org/apache/eventmesh/storage/redis/client/RedissonClient.java @@ -73,18 +73,15 @@ private static Redisson create(RedisProperties properties) { throw new StorageRuntimeException(message, ie); } + Config config = new Config(); + config.setCodec(CloudEventCodec.getInstance()); + config.setThreads(properties.getRedissonThreads()); + config.setNettyThreads(properties.getRedissonNettyThreads()); + String serverAddress = properties.getServerAddress(); String serverPassword = properties.getServerPassword(); String masterName = properties.getServerMasterName(); - Config config = OBJECT_MAPPER.convertValue(properties.getRedissonProperties(), Config.class); - - if (config == null) { - config = new Config(); - } - - config.setCodec(CloudEventCodec.getInstance()); - switch (serverType) { case SINGLE: config.useSingleServer() diff --git a/eventmesh-storage-plugin/eventmesh-storage-redis/src/main/java/org/apache/eventmesh/storage/redis/config/RedisProperties.java b/eventmesh-storage-plugin/eventmesh-storage-redis/src/main/java/org/apache/eventmesh/storage/redis/config/RedisProperties.java index a478e7a70f..b1e9f1a3af 100644 --- a/eventmesh-storage-plugin/eventmesh-storage-redis/src/main/java/org/apache/eventmesh/storage/redis/config/RedisProperties.java +++ b/eventmesh-storage-plugin/eventmesh-storage-redis/src/main/java/org/apache/eventmesh/storage/redis/config/RedisProperties.java @@ -20,8 +20,6 @@ import org.apache.eventmesh.common.config.Config; import org.apache.eventmesh.common.config.ConfigField; -import java.util.Properties; - import lombok.Data; @Data @@ -44,7 +42,7 @@ public class RedisProperties { * The address of the redis server following format -- host1:port1,host2:port2,…… */ @ConfigField(field = "serverAddress") - private String serverAddress; + private String serverAddress = "redis://127.0.0.1:6379"; /** * The password for redis authentication. @@ -55,8 +53,11 @@ public class RedisProperties { /** * The redisson options, redisson properties prefix is `eventMesh.server.redis.redisson` */ - @ConfigField(field = "redisson") - private Properties redissonProperties; + @ConfigField(field = "redisson.threads") + private int redissonThreads = 16; + + @ConfigField(field = "redisson.nettyThreads") + private int redissonNettyThreads = 32; public enum ServerType { SINGLE, diff --git a/eventmesh-storage-plugin/eventmesh-storage-redis/src/main/resources/redis-client.properties b/eventmesh-storage-plugin/eventmesh-storage-redis/src/main/resources/redis-client.properties index e024dca8ac..9baf41f360 100644 --- a/eventmesh-storage-plugin/eventmesh-storage-redis/src/main/resources/redis-client.properties +++ b/eventmesh-storage-plugin/eventmesh-storage-redis/src/main/resources/redis-client.properties @@ -15,5 +15,9 @@ # limitations under the License. # -eventMesh.server.redis.serverAddress= +eventMesh.server.redis.serverAddress=redis://127.0.0.1:6379 eventMesh.server.redis.serverPassword= +eventMesh.server.redis.serverType=SINGLE +eventMesh.server.redis.serverMasterName=master +eventMesh.server.redis.redisson.threads= +eventMesh.server.redis.redisson.nettyThreads= diff --git a/eventmesh-storage-plugin/eventmesh-storage-redis/src/test/java/org/apache/eventmesh/storage/redis/AbstractRedisServer.java b/eventmesh-storage-plugin/eventmesh-storage-redis/src/test/java/org/apache/eventmesh/storage/redis/AbstractRedisServer.java index 7aab9737d4..cefca9ea4b 100644 --- a/eventmesh-storage-plugin/eventmesh-storage-redis/src/test/java/org/apache/eventmesh/storage/redis/AbstractRedisServer.java +++ b/eventmesh-storage-plugin/eventmesh-storage-redis/src/test/java/org/apache/eventmesh/storage/redis/AbstractRedisServer.java @@ -17,25 +17,19 @@ package org.apache.eventmesh.storage.redis; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; +import java.io.IOException; -import ai.grakn.redismock.RedisServer; +import com.github.fppt.jedismock.RedisServer; public abstract class AbstractRedisServer { - private static RedisServer redisServer; + private static final RedisServer redisServer; - @BeforeAll - public static void setupRedisServer() throws Exception { - redisServer = RedisServer.newRedisServer(6379); - redisServer.start(); - } - - @AfterAll - public static void shutdownRedisServer() { - if (redisServer != null) { - redisServer.stop(); + static { + try { + redisServer = RedisServer.newRedisServer(6379).start(); + } catch (IOException e) { + throw new RuntimeException(e); } } } diff --git a/eventmesh-storage-plugin/eventmesh-storage-redis/src/test/java/org/apache/eventmesh/storage/redis/config/RedisPropertiesTest.java b/eventmesh-storage-plugin/eventmesh-storage-redis/src/test/java/org/apache/eventmesh/storage/redis/config/RedisPropertiesTest.java index 677dc406e5..c284fb89da 100644 --- a/eventmesh-storage-plugin/eventmesh-storage-redis/src/test/java/org/apache/eventmesh/storage/redis/config/RedisPropertiesTest.java +++ b/eventmesh-storage-plugin/eventmesh-storage-redis/src/test/java/org/apache/eventmesh/storage/redis/config/RedisPropertiesTest.java @@ -19,8 +19,6 @@ import org.apache.eventmesh.common.config.ConfigService; -import java.util.Properties; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -37,11 +35,7 @@ private void assertConfig(RedisProperties config) { Assertions.assertEquals("redis://127.0.0.1:6379", config.getServerAddress()); Assertions.assertEquals(RedisProperties.ServerType.SINGLE, config.getServerType()); Assertions.assertEquals("serverMasterName-success!!!", config.getServerMasterName()); - - Properties properties = new Properties(); - properties.put("threads", "2"); - properties.put("nettyThreads", "2"); - Properties redissonProperties = config.getRedissonProperties(); - Assertions.assertEquals(properties, redissonProperties); + Assertions.assertEquals(2, config.getRedissonThreads()); + Assertions.assertEquals(2, config.getRedissonNettyThreads()); } }