We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expected behavior
Actual behavior
Steps to reproduce or test case springboot3 with redisson, follow the code
private final RedisTemplate<String,Object> redisTemplate; ...... redisTemplate.opsForHash().putAll(user.getId(), map);
Redis version
Redisson version 3.18.0 Redisson configuration
package org.xiaowu.behappy.netty.chatroom.config; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator; import com.fasterxml.jackson.databind.module.SimpleModule; import org.redisson.spring.starter.RedissonAutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.data.redis.RedisProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cache.interceptor.KeyGenerator; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.DependsOn; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.RedisSerializer; /** * @author xiaowu * redis 配置类 */ @Configuration @AutoConfigureBefore(RedissonAutoConfiguration.class) @EnableConfigurationProperties({RedisProperties.class}) public class RedisAutoConfiguration { @Bean public RedisSerializer<String> redisKeySerializer() { return RedisSerializer.string(); } @Bean public RedisSerializer<Object> redisValueSerializer() { return new GenericJackson2JsonRedisSerializer(getObjectMapper()); } /** * StringRedisTemplate配置 */ @Bean public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory factory , RedisSerializer<String> redisKeySerializer, RedisSerializer<Object> redisValueSerializer) { StringRedisTemplate redisTemplate = new StringRedisTemplate(); redisTemplate.setConnectionFactory(factory); redisTemplate.setDefaultSerializer(redisValueSerializer); redisTemplate.setKeySerializer(redisKeySerializer); redisTemplate.setHashKeySerializer(redisKeySerializer); redisTemplate.afterPropertiesSet(); return redisTemplate; } /** * RedisTemplate配置 */ @Bean public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory , RedisSerializer<String> redisKeySerializer, RedisSerializer<Object> redisValueSerializer) { RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>(); redisTemplate.setConnectionFactory(factory); redisTemplate.setDefaultSerializer(redisValueSerializer); redisTemplate.setKeySerializer(redisKeySerializer); redisTemplate.setHashKeySerializer(redisKeySerializer); redisTemplate.afterPropertiesSet(); return redisTemplate; } private static ObjectMapper getObjectMapper() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); objectMapper.registerModule((new SimpleModule())); objectMapper.configure(MapperFeature.USE_ANNOTATIONS, false); objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); objectMapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL); return objectMapper; } }
spring: data: redis: host: password: port: lettuce: pool: enabled: true maxactive: 64 maxidle: 64 maxwait: -1 minidle: 1
The text was updated successfully, but these errors were encountered:
Make sure that you use correct version of redisson-spring-data module corresponding to Spring Data Redis version https://github.com/redisson/redisson/tree/master/redisson-spring-data#1-add-redisson-spring-data-dependency-into-your-project
Sorry, something went wrong.
i thought redisson had already compatibility with Spring Boot 3
Fixed in #4689
No branches or pull requests
Expected behavior
Actual behavior
Steps to reproduce or test case
springboot3 with redisson, follow the code
Redis version
Redisson version
3.18.0
Redisson configuration
The text was updated successfully, but these errors were encountered: