19 Temmuz 2021 Pazartesi

SpringCache Redis RedisCacheManagerBuilderCustomizer Sınıfı

Örnek
Şöyle yaparız
@Bean
public RedisCacheManagerBuilderCustomizer redisCacheManagerBuilderCustomizer() {
  return builder -> builder
    .withCacheConfiguration(“AccountCache",
      RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofMinutes(60)))
    .withCacheConfiguration(“ProductCache",
      RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofMinutes(120)));
}

Hiç yorum yok:

Yorum Gönder