In my application im using spring session with redis as the data store. We track if a user is logged in/not based on the Session Destroyed event. Whenever we receive this event we will mark that session as inactive.
However I'm facing issues when the event is not getting published sometimes. I can see this in the log "Unable to publish SessionDestroyedEvent for session". Checking few examples when I checked the time on when this log was printed and when the session was actually destroyed I found that the difference is huge like a day/two even sometimes. As session key will be available only 5 minutes after it is expired due to the lag in the onMessage method it is not able to find the session and hence is not able to publish the SessionDestroyedEvent.
I'm yet to find out the cause of this lag, but is there any other way with which I can still make sure that I can still work on these session Id's without depending upon the event? One way I can think of is manually overriding the onMessage method but that will be too much work. And has anyone else also faced this kind of lag