RED-6224: Enabled multitenancy for redis cache

This commit is contained in:
deiflaender 2023-03-30 13:58:21 +02:00
parent a2261e081f
commit 5b7a6d5a48
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,5 @@
package com.iqser.red.keycloak.commons;
import java.time.Duration;
import org.springframework.boot.autoconfigure.cache.RedisCacheManagerBuilderCustomizer;
@ -15,6 +14,7 @@ public class DefaultKeyCloakCommonsConfiguration {
public static final String USERS_CACHE = "users";
@Bean
public RedisCacheManagerBuilderCustomizer redisUserCacheManagerBuilderCustomizer() {

View File

@ -33,7 +33,7 @@ public class UserListingService {
private final RetryTemplate retryTemplate = RetryTemplate.builder().maxAttempts(3).exponentialBackoff(1000, 2, 5000).build();
@Cacheable(value = USERS_CACHE, key = "'tenantId'")
@Cacheable(value = USERS_CACHE, key = "#tenantId")
public List<User> getAllUsers(String tenantId) {
return retryTemplate.execute(context -> {