Skip to content

Commit 030c17e

Browse files
authored
Replace embedded-redis with newer fork (#275)
* build: replace it.ozimov:embedded-redis with com.github.codemonstur:embedded-redis Support newer CPU architecture and newer OS from the new fork * test: refactor method signature to comply with new constructor signature
1 parent ef4e2d2 commit 030c17e

9 files changed

Lines changed: 21 additions & 14 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ext {
3737
mockitoVersion = "3.5.0"
3838
hamcrestVersion = "2.2"
3939
jacocoVersion = "0.8.8"
40-
embeddedRedisVersion = "0.7.2"
40+
embeddedRedisVersion = "1.4.3"
4141
h2Version = "2.1.214"
4242
tomcatVersion = "10.1.4"
4343

rqueue-spring-boot-starter/src/test/java/com/github/sonus21/rqueue/spring/boot/application/ApplicationListenerDisabled.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
3232
import org.springframework.data.redis.connection.RedisConnectionFactory;
3333
import org.springframework.transaction.annotation.EnableTransactionManagement;
34+
import java.io.IOException;
3435

3536
@PropertySource("classpath:application.properties")
3637
@SpringBootApplication(scanBasePackages = {"com.github.sonus21.rqueue.test"})
@@ -47,7 +48,7 @@ public static void main(String[] args) {
4748

4849
@PostConstruct
4950
@Override
50-
public void postConstruct() {
51+
public void postConstruct() throws IOException {
5152
init();
5253
monitor(redisHost, redisPort);
5354
}

rqueue-spring-common-test/src/main/java/com/github/sonus21/rqueue/test/application/ApplicationBasicConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.github.sonus21.junit.BootstrapRedis;
2222
import com.github.sonus21.junit.RedisBootstrapperBase;
2323
import com.github.sonus21.rqueue.utils.SerializationUtils;
24+
import java.io.IOException;
2425
import java.util.HashMap;
2526
import javax.sql.DataSource;
2627
import lombok.extern.slf4j.Slf4j;
@@ -55,7 +56,7 @@ public abstract class ApplicationBasicConfiguration extends RedisBootstrapperBas
5556
@Value("${rqueue.reactive.enabled:false}")
5657
protected boolean reactiveEnabled;
5758

58-
protected void init() {
59+
protected void init() throws IOException {
5960
final BootstrapRedis bootstrapRedis =
6061
Javanna.createAnnotation(
6162
BootstrapRedis.class,

rqueue-spring-common-test/src/main/java/com/github/sonus21/rqueue/test/application/ApplicationWithCustomMessageConverter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.github.sonus21.rqueue.config.SimpleRqueueListenerContainerFactory;
2020
import jakarta.annotation.PostConstruct;
2121
import jakarta.annotation.PreDestroy;
22+
import java.io.IOException;
2223
import java.nio.charset.StandardCharsets;
2324
import java.util.Collections;
2425
import org.springframework.context.annotation.Bean;
@@ -29,12 +30,12 @@
2930
public abstract class ApplicationWithCustomMessageConverter extends ApplicationBasicConfiguration {
3031

3132
@PostConstruct
32-
public void postConstruct() {
33+
public void postConstruct() throws IOException {
3334
init();
3435
}
3536

3637
@PreDestroy
37-
public void preDestroy() {
38+
public void preDestroy() throws IOException {
3839
cleanup();
3940
}
4041

rqueue-spring-common-test/src/main/java/com/github/sonus21/rqueue/test/application/BaseApplication.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@
2323
import org.springframework.data.redis.connection.RedisConnectionFactory;
2424
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
2525
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
26+
import java.io.IOException;
2627

2728
@Slf4j
2829
public abstract class BaseApplication extends ApplicationBasicConfiguration {
2930

3031
@PostConstruct
31-
public void postConstruct() {
32+
public void postConstruct() throws IOException {
3233
init();
3334
}
3435

3536
@PreDestroy
36-
public void preDestroy() {
37+
public void preDestroy() throws IOException {
3738
cleanup();
3839
}
3940

rqueue-spring-common-test/src/main/java/com/github/sonus21/rqueue/test/application/BaseApplicationWithBackoff.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import jakarta.annotation.PreDestroy;
2525
import org.springframework.beans.factory.annotation.Value;
2626
import org.springframework.context.annotation.Bean;
27+
import java.io.IOException;
2728

2829
public abstract class BaseApplicationWithBackoff extends ApplicationBasicConfiguration {
2930

@@ -37,12 +38,12 @@ public abstract class BaseApplicationWithBackoff extends ApplicationBasicConfigu
3738
private int exponentialBackoffInitialInterval;
3839

3940
@PostConstruct
40-
public void postConstruct() {
41+
public void postConstruct() throws IOException {
4142
init();
4243
}
4344

4445
@PreDestroy
45-
public void preDestroy() {
46+
public void preDestroy() throws IOException {
4647
cleanup();
4748
}
4849

rqueue-spring-common-test/src/main/java/com/github/sonus21/rqueue/test/application/MultiRedisSprigBaseApplication.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
2828
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
2929
import redis.embedded.RedisServer;
30+
import java.io.IOException;
3031

3132
@Slf4j
3233
public abstract class MultiRedisSprigBaseApplication extends ApplicationBasicConfiguration {
@@ -40,7 +41,7 @@ public abstract class MultiRedisSprigBaseApplication extends ApplicationBasicCon
4041
private RedisServer redisServer2;
4142

4243
@PostConstruct
43-
public void postConstruct() {
44+
public void postConstruct() throws IOException {
4445
init();
4546
if (redisServer2 == null) {
4647
redisServer2 = new RedisServer(redisPort2);
@@ -50,7 +51,7 @@ public void postConstruct() {
5051
}
5152

5253
@PreDestroy
53-
public void preDestroy() {
54+
public void preDestroy() throws IOException {
5455
cleanup();
5556
if (redisServer2 != null) {
5657
redisServer2.stop();

rqueue-test-util/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies {
2222
// https://mvnrepository.com/artifact/jakarta.persistence/jakarta.persistence-api
2323
api "jakarta.persistence:jakarta.persistence-api:${jakartaPersistenceVersion}"
2424
api "com.h2database:h2:${h2Version}"
25-
api "it.ozimov:embedded-redis:${embeddedRedisVersion}"
25+
api "com.github.codemonstur:embedded-redis:${embeddedRedisVersion}"
2626
// https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa
2727
api "org.springframework.data:spring-data-jpa:${springDataVersion}"
2828

rqueue-test-util/src/main/java/com/github/sonus21/junit/RedisBootstrapperBase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.github.sonus21.junit;
1818

1919
import java.io.BufferedReader;
20+
import java.io.IOException;
2021
import java.io.InputStreamReader;
2122
import java.util.ArrayList;
2223
import java.util.LinkedList;
@@ -40,7 +41,7 @@ public abstract class RedisBootstrapperBase {
4041
protected ExecutorService executorService;
4142
protected List<MonitorProcess> processes = new ArrayList<>();
4243

43-
protected void bootstrap(BootstrapRedis bootstrapRedis) {
44+
protected void bootstrap(BootstrapRedis bootstrapRedis) throws IOException {
4445
int monitorThreads = 0;
4546
if (bootstrapRedis.monitorRedis()) {
4647
if (bootstrapRedis.monitorThreadsCount() > 0) {
@@ -62,7 +63,7 @@ protected void bootstrap(BootstrapRedis bootstrapRedis) {
6263
}
6364
}
6465

65-
protected void cleanup() {
66+
protected void cleanup() throws IOException {
6667
if (redisServer != null) {
6768
redisServer.stop();
6869
}

0 commit comments

Comments
 (0)