I have followed the configuration guide for JBoss EAP 7.0 - 21.3.7 to set up externalized HttpSessions to JDG
The steps are pretty simple, my standalone.xml has:
<subsystem xmlns="urn:jboss:domain:infinispan:4.0">
<cache-container name="cacheContainer" default-cache="default-cache" module="org.jboss.as.clustering.web.infinispan" statistics-enabled="true">
<transport lock-timeout="60000"/>
<replicated-cache name="default-cache" mode="SYNC">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<remote-store cache="default" socket-timeout="60000" remote-servers="remote-jdg-server1 remote-jdg-server2" passivation="false" preload="true" purge="false" shared="true"/>
</replicated-cache>
</cache-container>
...
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<outbound-socket-binding name="remote-jdg-server1">
<remote-destination host="jdbserver1" port="11222"/>
</outbound-socket-binding>
<outbound-socket-binding name="remote-jdg-server2">
<remote-destination host="jdgserver2" port="11222"/>
</outbound-socket-binding>
Then I added a jboss-web.xml file to my application's WEB-INF folder, referencing the cache container and the remote store cache:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_10_0.xsd"
version="10.0">
<context-root>/myapp</context-root>
<replication-config>
<cache-name>cacheContainer.default-cache</cache-name>
<replication-granularity>SESSION</replication-granularity>
</replication-config>
</jboss-web>
However it doesn't seem to be working. I tested putting an attribute in session and restarting the server. Then I can see that it creates a new httpsession, not reusing the previous one and thus, missing the parameter set before. The logs don't show anything relevant.