diff --git a/quarkus/runtime/pom.xml b/quarkus/runtime/pom.xml index 0bfeaab5b0..0951b65c78 100644 --- a/quarkus/runtime/pom.xml +++ b/quarkus/runtime/pom.xml @@ -457,6 +457,10 @@ org.infinispan infinispan-core + + org.infinispan + infinispan-jboss-marshalling + junit junit diff --git a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusCacheManagerProvider.java b/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusCacheManagerProvider.java index d9c1fe3f9a..2dfa701004 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusCacheManagerProvider.java +++ b/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusCacheManagerProvider.java @@ -24,6 +24,7 @@ import java.nio.file.Paths; import org.infinispan.commons.util.FileLookupFactory; import org.infinispan.configuration.parsing.ConfigurationBuilderHolder; import org.infinispan.configuration.parsing.ParserRegistry; +import org.infinispan.jboss.marshalling.core.JBossUserMarshaller; import org.infinispan.manager.DefaultCacheManager; import org.jboss.logging.Logger; import org.keycloak.cluster.ManagedCacheManagerProvider; @@ -46,6 +47,11 @@ public final class QuarkusCacheManagerProvider implements ManagedCacheManagerPro configureTransportStack(config, builder); } + // For Infinispan 10, we go with the JBoss marshalling. + // TODO: This should be replaced later with the marshalling recommended by infinispan. Probably protostream. + // See https://infinispan.org/docs/stable/titles/developing/developing.html#marshalling for the details + builder.getGlobalConfigurationBuilder().serialization().marshaller(new JBossUserMarshaller()); + return (C) new DefaultCacheManager(builder, false); } catch (Exception e) { throw new RuntimeException(e);