Class IgniteCacheAutoConfiguration.GracefulCacheConfiguration

java.lang.Object
com.broadleafcommerce.common.extension.autoconfigure.IgniteCacheAutoConfiguration.GracefulCacheConfiguration
All Implemented Interfaces:
org.springframework.cache.annotation.CachingConfigurer
Enclosing class:
IgniteCacheAutoConfiguration

@Configuration public static class IgniteCacheAutoConfiguration.GracefulCacheConfiguration extends Object implements org.springframework.cache.annotation.CachingConfigurer
Configuration that provides a graceful cache error handler for Apache Ignite.

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 Details

    • GracefulCacheConfiguration

      public GracefulCacheConfiguration()
  • Method Details

    • errorHandler

      @Bean public org.springframework.cache.interceptor.CacheErrorHandler errorHandler()
      Specified by:
      errorHandler in interface org.springframework.cache.annotation.CachingConfigurer