Skip to content

Latest commit

 

History

History

customizing-cache-error-handler

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Cache Error Handler

In Spring, by default, SimpleCacheErrorHandler is used and simply throws the exception back at the client.

To change this behavior, e.g. not throwing any error during cache failure, we can use CachingConfigurerSupport to override the CacheErrorHandler.

@Configuration
@EnableCaching
public class AppConfig extends CachingConfigurerSupport {
	@Bean
	@Override
	public CacheErrorHandler errorHandler() {
		// configure and return CacheErrorHandler instance
	}
	// ...
}