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:
		
							parent
							
								
									74bf53586c
								
							
						
					
					
						commit
						68d0783c37
					
				| @ -33,7 +33,7 @@ | ||||
|         <dependency> | ||||
|             <groupId>redis.clients</groupId> | ||||
|             <artifactId>jedis</artifactId> | ||||
|             <version>${redisson.version}</version> | ||||
|             <version>${jedis.version}</version> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>com.github.kstyrc</groupId> | ||||
| @ -48,12 +48,19 @@ | ||||
|         <dependency> | ||||
|             <groupId>io.lettuce</groupId> | ||||
|             <artifactId>lettuce-core</artifactId> | ||||
|             </dependency> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>io.netty</groupId> | ||||
|             <artifactId>netty-transport-native-epoll</artifactId> | ||||
|             <version>${epoll.version}</version> | ||||
|         </dependency> | ||||
|     </dependencies> | ||||
| 
 | ||||
|     <properties>         | ||||
|         <embedded-redis.version>0.6</embedded-redis.version> | ||||
|         <redisson.version>3.3.0</redisson.version>         | ||||
|         <redisson.version>3.13.1</redisson.version> | ||||
|         <jedis.version>3.3.0</jedis.version> | ||||
|         <epoll.version>4.1.50.Final</epoll.version> | ||||
|     </properties> | ||||
| 
 | ||||
| </project> | ||||
|  | ||||
| @ -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> {} | ||||
| @ -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); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user