BAEL-4325: Upgrade reddison to 3.13.1 (#9588)
* BAEL-4325: Upgrade reddison to 3.13.1 * BAEL-4325: Add jedis.version property
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package com.baeldung;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by johnson on 3/9/17.
|
||||
*/
|
||||
public class CustomMessage {
|
||||
public class CustomMessage implements Serializable {
|
||||
private String message;
|
||||
|
||||
public CustomMessage() {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.baeldung;
|
||||
|
||||
public class Ledger {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Ledger implements Serializable {
|
||||
|
||||
public Ledger() {
|
||||
}
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
{
|
||||
"singleServerConfig": {
|
||||
"idleConnectionTimeout": 10000,
|
||||
"pingTimeout": 1000,
|
||||
"connectTimeout": 10000,
|
||||
"timeout": 3000,
|
||||
"retryAttempts": 3,
|
||||
"retryInterval": 1500,
|
||||
"reconnectionTimeout": 3000,
|
||||
"failedAttempts": 3,
|
||||
"password": null,
|
||||
"subscriptionsPerConnection": 5,
|
||||
"clientName": null,
|
||||
@@ -17,11 +14,9 @@
|
||||
"connectionMinimumIdleSize": 10,
|
||||
"connectionPoolSize": 64,
|
||||
"database": 0,
|
||||
"dnsMonitoring": false,
|
||||
"dnsMonitoringInterval": 5000
|
||||
},
|
||||
"threads": 0,
|
||||
"nettyThreads": 0,
|
||||
"codec": null,
|
||||
"useLinuxNativeEpoll": false
|
||||
"codec": null
|
||||
}
|
||||
@@ -1,12 +1,9 @@
|
||||
singleServerConfig:
|
||||
idleConnectionTimeout: 10000
|
||||
pingTimeout: 1000
|
||||
connectTimeout: 10000
|
||||
timeout: 3000
|
||||
retryAttempts: 3
|
||||
retryInterval: 1500
|
||||
reconnectionTimeout: 3000
|
||||
failedAttempts: 3
|
||||
password: null
|
||||
subscriptionsPerConnection: 5
|
||||
clientName: null
|
||||
@@ -16,9 +13,7 @@ singleServerConfig:
|
||||
connectionMinimumIdleSize: 10
|
||||
connectionPoolSize: 64
|
||||
database: 0
|
||||
dnsMonitoring: false
|
||||
dnsMonitoringInterval: 5000
|
||||
threads: 0
|
||||
nettyThreads: 0
|
||||
codec: !<org.redisson.codec.JsonJacksonCodec> {}
|
||||
useLinuxNativeEpoll: false
|
||||
codec: !<org.redisson.codec.JsonJacksonCodec> {}
|
||||
+1
-1
@@ -48,7 +48,7 @@ public class RedissonConfigurationIntegrationTest {
|
||||
public void givenJavaConfig_thenRedissonConnectToRedis() {
|
||||
Config config = new Config();
|
||||
config.useSingleServer()
|
||||
.setAddress(String.format("127.0.0.1:%s", port));
|
||||
.setAddress(String.format("redis://127.0.0.1:%s", port));
|
||||
|
||||
client = Redisson.create(config);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.redisson.Redisson;
|
||||
import org.redisson.RedissonMultiLock;
|
||||
import org.redisson.api.*;
|
||||
import org.redisson.client.RedisClient;
|
||||
import org.redisson.client.RedisClientConfig;
|
||||
import org.redisson.client.RedisConnection;
|
||||
import org.redisson.client.codec.StringCodec;
|
||||
import org.redisson.client.protocol.RedisCommands;
|
||||
@@ -103,10 +104,10 @@ public class RedissonIntegrationTest {
|
||||
public void givenTopicSubscribedToAChannel_thenReceiveMessageFromChannel() throws ExecutionException, InterruptedException {
|
||||
CompletableFuture<String> future = new CompletableFuture<>();
|
||||
|
||||
RTopic<CustomMessage> subscribeTopic = client.getTopic("baeldung");
|
||||
subscribeTopic.addListener((channel, customMessage) -> future.complete(customMessage.getMessage()));
|
||||
RTopic subscribeTopic = client.getTopic("baeldung");
|
||||
subscribeTopic.addListener(CustomMessage.class, (channel, customMessage) -> future.complete(customMessage.getMessage()));
|
||||
|
||||
RTopic<CustomMessage> publishTopic = client.getTopic("baeldung");
|
||||
RTopic publishTopic = client.getTopic("baeldung");
|
||||
long clientsReceivedMessage
|
||||
= publishTopic.publish(new CustomMessage("This is a message"));
|
||||
|
||||
@@ -203,10 +204,10 @@ public class RedissonIntegrationTest {
|
||||
batch.getMap("ledgerMap").fastPutAsync("1", "2");
|
||||
batch.getMap("ledgerMap").putAsync("2", "5");
|
||||
|
||||
List<?> result = batch.execute();
|
||||
BatchResult<?> batchResult = batch.execute();
|
||||
|
||||
RMap<String, String> map = client.getMap("ledgerMap");
|
||||
assertTrue(result.size() > 0 && map.get("1").equals("2"));
|
||||
assertTrue(batchResult.getResponses().size() > 0 && map.get("1").equals("2"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -220,7 +221,9 @@ public class RedissonIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void givenLowLevelRedisCommands_thenExecuteLowLevelCommandsOnRedis(){
|
||||
RedisClient client = new RedisClient("localhost", 6379);
|
||||
RedisClientConfig redisClientConfig = new RedisClientConfig();
|
||||
redisClientConfig.setAddress("localhost", 6379);
|
||||
RedisClient client = RedisClient.create(redisClientConfig);
|
||||
RedisConnection conn = client.connect();
|
||||
conn.sync(StringCodec.INSTANCE, RedisCommands.SET, "test", 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user