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
如图序列化无法识别List中的泛型,只能拿到结果后再次序列化。 有没有更好的方式解决这个问题
The text was updated successfully, but these errors were encountered:
方法就是不要用json做序列化
Sorry, something went wrong.
有具体方案吗?
方法就是不要用json做序列化 有具体方案吗?
1.使用Jackson2序列化时会记录类型信息, 但是报文会很大. 2. 编程式的方式,你可以手动创建Cache对象,并且自己指定好对应的序列化和反序列化编解码,不使用统一的json序列化,因为无法顾及到所有的情况,应该由编写的人自己来解决
可参考:
QuickConfig systemConfigCacheConfig = QuickConfig .newBuilder("test", "system:config:") .expire(Duration.ofSeconds(86410)) .cacheType(CacheType.REMOTE) // 自己序列化 .valueEncoder(JacksonUtils::objectToByteArray) // 自己反序列化 .valueDecoder((bytes)-> JacksonUtils.byteArrayToObject(bytes, new TypeReference<CacheValueHolder>() {})) .build(); Cache<String, SystemConfigDTO> cache = cacheManager.getOrCreateCache(systemConfigCacheConfig);
No branches or pull requests
如图序列化无法识别List中的泛型,只能拿到结果后再次序列化。
有没有更好的方式解决这个问题
The text was updated successfully, but these errors were encountered: