Class IgniteCacheAutoConfiguration.GracefulCacheConfiguration
- All Implemented Interfaces:
org.springframework.cache.annotation.CachingConfigurer
- Enclosing class:
- IgniteCacheAutoConfiguration
This configuration implements CachingConfigurer
to customize how Spring handles exceptions that occur during cache operations. Specifically,
it overrides the handleCachePutError behavior to gracefully handle Ignite
Out-Of-Memory (OOM) scenarios.
When an Ignite DataRegion reaches its maximum capacity, attempting to put new items into the
cache throws an exception. Instead of propagating this exception and potentially disrupting
the application's normal flow, this custom error handler catches the OOM exception,
suppresses it, and logs a warning. To prevent log spamming, the warning is rate-limited and
will only be emitted at most once every 15 minutes. Other types of cache put errors are
delegated to the default
SimpleCacheErrorHandler.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.cache.interceptor.CacheErrorHandlerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.cache.annotation.CachingConfigurer
cacheManager, cacheResolver, keyGenerator
-
Constructor Details
-
GracefulCacheConfiguration
public GracefulCacheConfiguration()
-
-
Method Details
-
errorHandler
@Bean public org.springframework.cache.interceptor.CacheErrorHandler errorHandler()- Specified by:
errorHandlerin interfaceorg.springframework.cache.annotation.CachingConfigurer
-