diff --git a/backend/src/main/java/com/dragonguard/backend/config/redis/RedisConfig.java b/backend/src/main/java/com/dragonguard/backend/config/redis/RedisConfig.java index f41b795d..d5c1a4be 100644 --- a/backend/src/main/java/com/dragonguard/backend/config/redis/RedisConfig.java +++ b/backend/src/main/java/com/dragonguard/backend/config/redis/RedisConfig.java @@ -4,6 +4,7 @@ import org.redisson.Redisson; import org.redisson.api.RedissonClient; import org.redisson.config.Config; +import org.redisson.spring.data.connection.RedissonConnectionFactory; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; @@ -38,19 +39,19 @@ public class RedisConfig { @Bean public RedissonClient redissonClient() { - Config config = new Config(); + final Config config = new Config(); config.useSingleServer().setAddress(REDISSON_HOST_PREFIX + redisProperties.getHost() + URL_DELIMITER + redisProperties.getPort()); return Redisson.create(config); } @Bean public RedisConnectionFactory redisConnectionFactory() { - return new LettuceConnectionFactory(redisProperties.getHost(), redisProperties.getPort()); + return new RedissonConnectionFactory(redissonClient()); } @Bean public RedisTemplate redisTemplate() { - RedisTemplate redisTemplate = new RedisTemplate<>(); + final RedisTemplate redisTemplate = new RedisTemplate<>(); redisTemplate.setConnectionFactory(redisConnectionFactory()); redisTemplate.setKeySerializer(new StringRedisSerializer()); redisTemplate.setEnableTransactionSupport(false); @@ -58,8 +59,8 @@ public RedisConnectionFactory redisConnectionFactory() { } @Bean - public CacheManager cacheManager(RedisConnectionFactory cf) { - RedisCacheConfiguration redisCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig() + public CacheManager cacheManager(final RedisConnectionFactory cf) { + final RedisCacheConfiguration redisCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig() .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer())) .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer())) .entryTtl(Duration.ofHours(TIME_TO_LIVE)); diff --git a/backend/src/main/java/com/dragonguard/backend/utils/EmailSender.java b/backend/src/main/java/com/dragonguard/backend/utils/EmailSender.java index a45f4b94..6cf7cb21 100644 --- a/backend/src/main/java/com/dragonguard/backend/utils/EmailSender.java +++ b/backend/src/main/java/com/dragonguard/backend/utils/EmailSender.java @@ -53,10 +53,10 @@ public void sendDeadLetter(final DeadLetter deadLetter) throws MessagingExceptio } private String getDeadLetterText(final DeadLetter deadLetter) { - final String content = "topic-name" + deadLetter.getTopicName() - + "key-name" + deadLetter.getKeyName() - + "time" + deadLetter.getBaseTime().getCreatedAt() - + "payload" + deadLetter.getValueObject(); + final String content = "topic-name : " + deadLetter.getTopicName() + "\n" + + "key-name : " + deadLetter.getKeyName() + "\n" + + "time : " + deadLetter.getBaseTime().getCreatedAt() + "\n" + + "payload : " + deadLetter.getValueObject(); return String.format(DEAD_LETTER_CONTENT, content); }