I’m currently trying to configure the cache JDBC store for Infinispan.
I’m running Keycloak in ECS and don’t want to lose all user sessions, etc. every time I’m deploying a new version of the Keycloak service.
Since Redis is not working in WildFly, I tried the JDBC store. With a bit of tinkering I got it set up and Keycloak even creates the database tables on start.
Whenever Keycloak pushes an entry into the cache, it throws an exception.
14:29:28,237 ERROR [org.infinispan.interceptors.impl.InvocationContextInterceptor] (default task-6) ISPN000136: Error executing command PutKeyValueCommand on Cache 'clientSessions', writing keys [7ae59e20-57b7-4a4f-85bc-dc609a96cb9c]: org.infinispan.persistence.keymappers.UnsupportedKeyTypeException: Unsupported key type: 'java.util.UUID' on key: 7ae59e20-57b7-4a4f-85bc-dc609a96cb9c
I’m using Keycloak 12.0.1 with MySQL 5.7 and the JDBC store is enabled by a script that contains these two lines for every distributed-cache entry:
/subsystem=infinispan/cache-container=keycloak/distributed-cache=clientSessions/store=jdbc:add(data-source=KeycloakDS)
/subsystem=infinispan/cache-container=keycloak/distributed-cache=clientSessions/store=jdbc/table=string:write-attribute(name=id-column, value={type="VARCHAR(200)"})
This happens with store=jdbc as well as store=binary-jdbc.
Am I missing something that I need to configure? Is this missing some marshaller? Do I need to create additional data-columns?
Also the default create statements for the JDBC store are not working with MySQL, is there some undocumented configuration to tell Infinispan what DB vendor it is talking to?