Commit 15b8036 1 parent f4f0d04 commit 15b8036 Copy full SHA for 15b8036
File tree 10 files changed +38
-53
lines changed
eventmesh-connectors/eventmesh-connector-redis
eventmesh-storage-plugin/eventmesh-storage-redis
java/org/apache/eventmesh/storage/redis
test/java/org/apache/eventmesh/storage/redis
10 files changed +38
-53
lines changed Original file line number Diff line number Diff line change 59
59
- name : GenerateGrammarSource
60
60
run : ./gradlew clean generateGrammarSource --parallel --daemon --scan
61
61
env :
62
- GRADLE_ENTERPRISE_ACCESS_KEY : ${{ secrets.GE_ACCESS_TOKEN }}
62
+ DEVELOCITY_ACCESS_KEY : ${{ secrets.GE_ACCESS_TOKEN }}
63
63
64
64
- name : Set up JDK ${{ matrix.java }}
65
65
uses : actions/setup-java@v4
@@ -69,14 +69,16 @@ jobs:
69
69
70
70
# https://docs.gradle.org/current/userguide/performance.html
71
71
- name : Build
72
- run : ./gradlew clean build dist jacocoTestReport -x spotlessJava -x generateGrammarSource --parallel --daemon --scan
72
+ run : >
73
+ ./gradlew clean build dist jacocoTestReport --parallel --daemon --scan
74
+ -x spotlessJava -x generateGrammarSource -x generateDistLicense -x checkDeniedLicense
73
75
env :
74
- GRADLE_ENTERPRISE_ACCESS_KEY : ${{ secrets.GE_ACCESS_TOKEN }}
76
+ DEVELOCITY_ACCESS_KEY : ${{ secrets.GE_ACCESS_TOKEN }}
75
77
76
78
- name : Install plugin
77
79
run : ./gradlew installPlugin --scan
78
80
env :
79
- GRADLE_ENTERPRISE_ACCESS_KEY : ${{ secrets.GE_ACCESS_TOKEN }}
81
+ DEVELOCITY_ACCESS_KEY : ${{ secrets.GE_ACCESS_TOKEN }}
80
82
81
83
- name : Upload coverage report to codecov.io
82
84
run : bash <(curl -s https://codecov.io/bash) || echo 'Failed to upload coverage report!'
Original file line number Diff line number Diff line change 68
68
if : matrix.language == 'java'
69
69
run : ./gradlew clean assemble compileTestJava --parallel --daemon --scan
70
70
env :
71
- GRADLE_ENTERPRISE_ACCESS_KEY : ${{ secrets.GE_ACCESS_TOKEN }}
71
+ DEVELOCITY_ACCESS_KEY : ${{ secrets.GE_ACCESS_TOKEN }}
72
72
73
73
- name : Perform CodeQL analysis
74
74
uses : github/codeql-action/analyze@v3
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ dependencies {
19
19
implementation project(" :eventmesh-common" )
20
20
implementation project(" :eventmesh-openconnect:eventmesh-openconnect-java" )
21
21
22
- implementation ' org.redisson:redisson:3.17.3 '
22
+ implementation ' org.redisson:redisson:3.30.0 '
23
23
24
24
api ' io.cloudevents:cloudevents-json-jackson'
25
25
Original file line number Diff line number Diff line change @@ -20,24 +20,16 @@ dependencies {
20
20
implementation project(" :eventmesh-storage-plugin:eventmesh-storage-api" )
21
21
22
22
// redisson
23
- implementation(' org.redisson:redisson:3.17.3' ) {
24
- exclude group : ' io.netty' , module : ' netty-common'
25
- exclude group : ' io.netty' , module : ' netty-buffer'
26
- exclude group : ' io.netty' , module : ' netty-codec'
27
- exclude group : ' io.netty' , module : ' netty-transport'
28
- exclude group : ' io.netty' , module : ' netty-resolver'
29
- exclude group : ' io.netty' , module : ' netty-resolver-dns'
30
- exclude group : ' io.netty' , module : ' netty-handler'
31
- }
23
+ implementation ' org.redisson:redisson:3.30.0'
32
24
33
25
// netty
34
- implementation " io.netty:netty-all"
26
+ implementation ' io.netty:netty-all'
35
27
36
28
// auxiliary serialize
37
29
api ' io.cloudevents:cloudevents-json-jackson'
38
30
39
31
// test dependencies
40
- testImplementation ' ai.grakn:redis -mock:0 .1.6 '
32
+ testImplementation ' com.github.fppt:jedis -mock:1 .1.1 '
41
33
testImplementation " org.mockito:mockito-core"
42
34
43
35
compileOnly ' org.projectlombok:lombok'
Original file line number Diff line number Diff line change
1
+ #
1
2
# Licensed to the Apache Software Foundation (ASF) under one or more
2
3
# contributor license agreements. See the NOTICE file distributed with
3
4
# this work for additional information regarding copyright ownership.
Original file line number Diff line number Diff line change @@ -73,18 +73,15 @@ private static Redisson create(RedisProperties properties) {
73
73
throw new StorageRuntimeException (message , ie );
74
74
}
75
75
76
+ Config config = new Config ();
77
+ config .setCodec (CloudEventCodec .getInstance ());
78
+ config .setThreads (properties .getRedissonThreads ());
79
+ config .setNettyThreads (properties .getRedissonNettyThreads ());
80
+
76
81
String serverAddress = properties .getServerAddress ();
77
82
String serverPassword = properties .getServerPassword ();
78
83
String masterName = properties .getServerMasterName ();
79
84
80
- Config config = OBJECT_MAPPER .convertValue (properties .getRedissonProperties (), Config .class );
81
-
82
- if (config == null ) {
83
- config = new Config ();
84
- }
85
-
86
- config .setCodec (CloudEventCodec .getInstance ());
87
-
88
85
switch (serverType ) {
89
86
case SINGLE :
90
87
config .useSingleServer ()
Original file line number Diff line number Diff line change 20
20
import org .apache .eventmesh .common .config .Config ;
21
21
import org .apache .eventmesh .common .config .ConfigField ;
22
22
23
- import java .util .Properties ;
24
-
25
23
import lombok .Data ;
26
24
27
25
@ Data
@@ -44,7 +42,7 @@ public class RedisProperties {
44
42
* The address of the redis server following format -- host1:port1,host2:port2,……
45
43
*/
46
44
@ ConfigField (field = "serverAddress" )
47
- private String serverAddress ;
45
+ private String serverAddress = "redis://127.0.0.1:6379" ;
48
46
49
47
/**
50
48
* The password for redis authentication.
@@ -55,8 +53,11 @@ public class RedisProperties {
55
53
/**
56
54
* The redisson options, redisson properties prefix is `eventMesh.server.redis.redisson`
57
55
*/
58
- @ ConfigField (field = "redisson" )
59
- private Properties redissonProperties ;
56
+ @ ConfigField (field = "redisson.threads" )
57
+ private int redissonThreads = 16 ;
58
+
59
+ @ ConfigField (field = "redisson.nettyThreads" )
60
+ private int redissonNettyThreads = 32 ;
60
61
61
62
public enum ServerType {
62
63
SINGLE ,
Original file line number Diff line number Diff line change 15
15
# limitations under the License.
16
16
#
17
17
18
- eventMesh.server.redis.serverAddress =
18
+ eventMesh.server.redis.serverAddress =redis://127.0.0.1:6379
19
19
eventMesh.server.redis.serverPassword =
20
+ eventMesh.server.redis.serverType =SINGLE
21
+ eventMesh.server.redis.serverMasterName =master
22
+ eventMesh.server.redis.redisson.threads =
23
+ eventMesh.server.redis.redisson.nettyThreads =
Original file line number Diff line number Diff line change 17
17
18
18
package org .apache .eventmesh .storage .redis ;
19
19
20
- import org .junit .jupiter .api .AfterAll ;
21
- import org .junit .jupiter .api .BeforeAll ;
20
+ import java .io .IOException ;
22
21
23
- import ai . grakn . redismock .RedisServer ;
22
+ import com . github . fppt . jedismock .RedisServer ;
24
23
25
24
public abstract class AbstractRedisServer {
26
25
27
- private static RedisServer redisServer ;
26
+ private static final RedisServer redisServer ;
28
27
29
- @ BeforeAll
30
- public static void setupRedisServer () throws Exception {
31
- redisServer = RedisServer .newRedisServer (6379 );
32
- redisServer .start ();
33
- }
34
-
35
- @ AfterAll
36
- public static void shutdownRedisServer () {
37
- if (redisServer != null ) {
38
- redisServer .stop ();
28
+ static {
29
+ try {
30
+ redisServer = RedisServer .newRedisServer (6379 ).start ();
31
+ } catch (IOException e ) {
32
+ throw new RuntimeException (e );
39
33
}
40
34
}
41
35
}
Original file line number Diff line number Diff line change 19
19
20
20
import org .apache .eventmesh .common .config .ConfigService ;
21
21
22
- import java .util .Properties ;
23
-
24
22
import org .junit .jupiter .api .Assertions ;
25
23
import org .junit .jupiter .api .Test ;
26
24
@@ -37,11 +35,7 @@ private void assertConfig(RedisProperties config) {
37
35
Assertions .assertEquals ("redis://127.0.0.1:6379" , config .getServerAddress ());
38
36
Assertions .assertEquals (RedisProperties .ServerType .SINGLE , config .getServerType ());
39
37
Assertions .assertEquals ("serverMasterName-success!!!" , config .getServerMasterName ());
40
-
41
- Properties properties = new Properties ();
42
- properties .put ("threads" , "2" );
43
- properties .put ("nettyThreads" , "2" );
44
- Properties redissonProperties = config .getRedissonProperties ();
45
- Assertions .assertEquals (properties , redissonProperties );
38
+ Assertions .assertEquals (2 , config .getRedissonThreads ());
39
+ Assertions .assertEquals (2 , config .getRedissonNettyThreads ());
46
40
}
47
41
}
You can’t perform that action at this time.
0 commit comments