Sticky Sessions in JBoss

In workers.properties update lb worker:

worker.jboss.sticky_session=1

On a UNIX system add to jk.conf:

JkShmFile logs/jk.shm

In each Tomcats' server.xml set: <Engine ... jvmRoute="jboss1"> (or jboss2)

 

To enrich your career and become a JBoss professional, visit Tekslate, the global online training platform:" JBoss Training". This course will help you achieve excellence in this field.

After restarting, test with two browsers Directive sticky_session is set to 1 (or True) by default, but we turn it on to make it explicit. Enabling the shared memory file (JkShmFile) is not required, but allows the HTTPD processes to better communicate on a prefork-type system. The value of the jvmRoute attribute in server.xml`s `<Engine> must match the name of the worker instance as configured in the workers.properties file.

For an in-depth understanding on JBoss click on: