The default use of jdk serialization will cause the string to be escaped
In In actual development, when we want to store objects in redis, they must be serialized.
Of course, if we convert the object into a json string, what is stored is equivalent to a string. Not serializing does not affect normal operation
However, usually we have to serialize the objects we create.
If we don’t serialize, store the object
We create a redisTemplate object to overwrite the original redis template object in the bean container.
##c.
Case 3 uses jackon serialization (custom serialization) and the content is output normally.
b.
When case four is used normally, we usually The object is converted into json storage, and a certain java object is not directly stored.
The above is the detailed content of What are redis serialization and various serialization situations?. For more information, please follow other related articles on the PHP Chinese website!