Quantcast
Channel: Is there any way to store response entity in redis cache? - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Is there any way to store response entity in redis cache?

$
0
0

I've tried following code but got error - spring web ResponseEntity can't serialization.

org.springframework.data.redis.serializer.SerializationException: Cannot serialize; nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to serialize object using DefaultSerializer; nested exception is java.lang.IllegalArgumentException: DefaultSerializer requires a Serializable payload but received an object of type [org.springframework.http.ResponseEntity]

Tried following code:

@Override

@Transactional

@Cacheable(value = "mostFollowedSub", key = "{#root.methodName, #offset, #limit}" )
    public ResponseEntity<Response> mostFollowedSubCategory(int offset, int limit) {
        return subCategoryDao.getMostFollowedSubCategory(offset, limit);
    }

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>