Log a warning if remote-store configuration exists when the REMOTE_CACHE Feature is enabled

Closes #31775

Signed-off-by: Ryan Emerson <remerson@redhat.com>
This commit is contained in:
Ryan Emerson 2024-07-30 17:48:55 +01:00 committed by Alexander Schwartz
parent 8d7e18ec29
commit 349ff51116

View file

@ -223,7 +223,18 @@ public class CacheManagerFactory {
var builders = builder.getNamedConfigurationBuilders(); var builders = builder.getNamedConfigurationBuilders();
// remove all distributed caches // remove all distributed caches
logger.debug("Removing all distributed caches."); logger.debug("Removing all distributed caches.");
Arrays.stream(CLUSTERED_CACHE_NAMES).forEach(builders::remove); for (String cacheName : CLUSTERED_CACHE_NAMES) {
var remoteStore = builders.get(cacheName)
.persistence()
.stores()
.stream()
.filter(RemoteStoreConfigurationBuilder.class::isInstance)
.findFirst();
if (remoteStore.isPresent())
logger.warnf("remote-store configuration detected for cache '%s'. Explicit cache configuration ignored when using '%s' Feature", cacheName, Profile.Feature.REMOTE_CACHE.getKey());
builders.remove(cacheName);
}
} }
var start = isStartEagerly(); var start = isStartEagerly();