6 Şubat 2023 Pazartesi

SpringCache CompositeCacheManager Sınıfı

Örnek
Şöyle yaparız
@Configuration
class MyCachingConfiguration {

  @Bean
  RedisCacheManager cacheManager() {
    // ...
  }

  @Bean
  HazelcastCacheManager hazelcastCacheManager() {
    // ...
  }

  @Bean
  CompositeCacheManager compositeCacheManager(RedisCacheManager redis, 
    HazelcastCacheManager hazelcast) {
    return new CompositeCacheManager(redis, hazelcast);
  }
}

Hiç yorum yok:

Yorum Gönder