1
si utilisation @Cacheable pour la valeur de retour 'ResponseEntity', j'ai eu une erreur de sérialisation.web de printemps ResponseEntity ne peut pas sérialiser
Caused by: 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]
Démo:
@Controller
@CacheConfig(cacheNames = "logs")
public class LogController {
@Cacheable(key = "#id")
@RequestMapping(value = LogConstants.LOGS_ID_PATH, method = RequestMethod.GET)
public ResponseEntity<Log> findById(@PathVariable Long id) {
//....
}
}
N'a pas travaillé pour mon. Ma solution était de créer un composant pour être l'homme du milieu. –