Usually the “magic number” errors occur when there’s a mismatch between the Infinispan or JGroups versions.
As an aside, I’m not sure why you would have a single instance of Keycloak and single instance of Infinispan. Is this for a test? Why not just use multiple instances of Keycloak, with embedded Infinispan using persistent sessions. Don’t overcomplicate your deployment.
My goal is to implement caching capabilities in Keycloak for storing data from custom authentication SPIs. Additionally, I want to ensure that user sessions remain intact during updates or changes to the Keycloak instance, so users don’t have to log in again.
To achieve this, I set up Keycloak and Infinispan as separate entities. If Infinispan were embedded within Keycloak, it would be taken down whenever Keycloak deployment is updated, causing disruptions. By running Infinispan separately, I ensure it remains unaffected by Keycloak updates, preserving user sessions.
Am I missing something here ? I couldn’t find a lot of examples for Keycloak and Infinispan deployments, hence I’ve been improvising so far.
As @xgp already mentioned, you don’t need an external Infinispan server to keep sessions persistent, this was introduced with KC25 as preview and KC26 as supported feature. It’s here, out of the box, just go with the embedded Infinispan, this will reduce your personal headache level and increase confidence.
I also just published a video about persistent user sessions this morning: