- 去除springboot自带
Jackson,必须去除,画重点,springboot2.x在引入了spring-boot-starter-data-redis的时候,如果不去除Jackson,即使配置了FastJsonHttpMessageConverter,依然不生效,所以必须去除,但是如果不引入spring-boot-starter-data-redis则不影响,目前不知道原因,就去除了吧<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <artifactId>jackson-databind</artifactId> <groupId>com.fasterxml.jackson.core</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.60</version> </dependency> - 配置
GenericFastJson2JsonRedisSerializer
springboot2.x+Redis+Fastjson(坑已填),Redis使用Fastjson序列化
最新推荐文章于 2024-10-07 17:49:53 发布

最低0.47元/天 解锁文章
1913

被折叠的 条评论
为什么被折叠?



