背景
最近在使用redis保存对象时发现,对象是被序列化之后存入到redis中的,这样就不能直观的看到对象的属性信息,所以还是希望使用简单的json格式来保存对象到redis中。
那让我们来查看一下SpringBoot中默认的RedisTemplate的实现是什么
/**
* Helper class that simplifies Redis data access code.
* <p/>
* Performs automatic serialization/deserialization between the given objects and the underlying binary data in the
* Redis store. By default, it uses Java serialization for its objects (through {@link JdkSerializationRedisSerializer}
* ). For String intensive operations consider the dedicated {@link StringRedisTemplate}.
* <p/>
* The central method is execute, supporting Redis access code implementing the {@link RedisCallback} interface. It
* provides {@link RedisConnection} handling such that neither the {@link RedisCallback} implementation nor the calling
* code needs to explicitly care about retrieving/closing Redis connections, or handling Connection lif