Search code examples
javarediswildflyinfinispan

How to externalise HttpSession from WildFly to Redis? (W/O Spring Session)


Introduction

So, I'm currently working with some older Java EE applications, applications which are very much stateful, however, with recent changes, there's a need for these applications to become stateless. Rather than spend an insane amount of time refactoring the code, I thought it best to seek an alternative solution, perhaps something via configuration.

Note: Now please bear with me, if I lack knowledge in any given topic that I'm going to cover in this question, please feel free to educate me. I know there are some areas where I could easily improve with, i.e. DevOps, it's hardly my strongest topic.


The Problem

I've seen many solutions that makes use of Spring, or more precisely Spring Session & that approach looks awesome, very clean, clear & straightforward. However, as initially stated, rather than refactor loads of our existing code, or any for that matter, I was hoping to find an alternative solution.

My current progress is still investigating time into conducting research, mostly because I'm still to discover anything that appears solid/fool proof. At best, this is the best thing I've found so far, the only problem is, prior to this issue, I didn't even know what Infinispan was, so I'm hardly an expert at configuring Infinispan with WildFly.

I've also stumbled across this comment, which looks potentially somewhat promising, but sadly I'm personally unsure of how I could utilise this, again, a lack of education on this topic.


Finally

I'd like to thank anyone that could help me in advance, I'm not asking for someone to hand me a solution, rather point me in the right direction(s). I'd like to actually educate myself on this topic, from what I've read so far, I've already learned quite a bit, but I'm still far from an expert on this subject. I also know that I also need to improve my abilities with regards to configuring WildFly/JBoss.

P.S. Any form of reading material would be amazing, free or not.


Solution

  • WildFly does not do this. You can however externalize to an Infinispan Server cluster (disclosure: I work on Infinispan). Documentation for the product counterparts (EAP and JDG) is available here: https://access.redhat.com/documentation/en-us/red_hat_data_grid/7.2/html/administration_and_configuration_guide/externalize_sessions#externalize_http_session_from_jboss_eap_to_jboss_data_grid