samedi 4 avril 2015

Memcached Session Manager + Spring Deferred Result

I'm using Memcached Session Manager (documentation here) on a Spring + Tomcat application. I am using non-sticky sessions and a single memcached node. Session persistence is working correctly, except for when I try to modify the session associated with a long-polling request. I am storing a Map of DeferredResult --> HttpSession, and when users need to be notified about an update in the application, I iterate over the entry set of the Map. At that point, information about the various user states is updated in their sessions. I have checked that after setting the information in the session, and immediately retrieving it from the session, the state has been updated. But, when the user sends their next long-polling request, the updated state information has not been saved. Here is my MSM configuration:



<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="(single node)"
sticky="false"
sessionBackupAsync="false"
lockingMode="http://uriPattern:/(.*)Updates(.*)\.html"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
/>


With typical HTTP requests, I have not seen this problem, only when holding onto the DeferredResult of the user and then trying to update the session information. Is there something wrong with my configuration, or some way that I can manually trigger a save?


Any help is appreciated!


Aucun commentaire:

Enregistrer un commentaire