memcached-session-manager | tomcat session manager that backups sessions | Plugin library

 by   magro Java Version: v2.3.0 License: Apache-2.0

kandi X-RAY | memcached-session-manager Summary

kandi X-RAY | memcached-session-manager Summary

memcached-session-manager is a Java library typically used in Plugin applications. memcached-session-manager has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub, Maven.

memcached-session-manager is a tomcat session manager that keeps sessions in memcached or Redis, for highly available, scalable and fault tolerant web applications. It supports both sticky and non-sticky configurations, and is currently working with tomcat 6.x, 7.x, 8.x and 9.x. For sticky sessions session failover (tomcat crash) is supported, for non-sticky sessions this is the default (a session is served by default by different tomcats for different requests). Also memcached failover (memcached crash) is supported via migration of sessions. There shall also be no single point of failure, so when a memcached fails the session will not be lost (but either be available in tomcat or in another memcached).

            kandi-support Support

              memcached-session-manager has a medium active ecosystem.
              It has 760 star(s) with 355 fork(s). There are 100 watchers for this library.
              It had no major release in the last 12 months.
              There are 78 open issues and 270 have been closed. On average issues are closed in 89 days. There are 21 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of memcached-session-manager is v2.3.0

            kandi-Quality Quality

              memcached-session-manager has 0 bugs and 0 code smells.

            kandi-Security Security

              memcached-session-manager has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              memcached-session-manager code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              memcached-session-manager is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              memcached-session-manager releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions are available. Examples and code snippets are not available.
              It has 21074 lines of code, 2088 functions and 203 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed memcached-session-manager and discovered the below as its top functions. This is intended to give you an instant insight into memcached-session-manager implemented functionality, and help decide if they suit your requirements.
            • Performs warmup operation .
            • Creates a new MemcachedNodesManager for the given MemcachedNodes .
            • Performs the backup operation .
            • Loads a backup session from memcached .
            • Backup a session to memcached .
            • Deserialize session fields .
            • Creates the Kryo factory .
            • Invoked after a session has been initiated .
            • Handles the request .
            • Handle a GET request .
            Get all kandi verified functions for this library.

            memcached-session-manager Key Features

            No Key Features are available at this moment for memcached-session-manager.

            memcached-session-manager Examples and Code Snippets

            No Code Snippets are available at this moment for memcached-session-manager.

            Community Discussions


            Tomcat Memcached dependencies bundled with WAR
            Asked 2019-Jan-02 at 00:01

            I'm currently using memcached-tomcat-session-manager with Tomcat7 for session storage.

            This is setup in the prescribed manner with the various memcached / transcoder / serializer JARs in $CATALINA_HOME/lib and $CATALINA_HOME/conf/context.xml with a ... entry and works just fine.

            A situation has arisen where I'd like to share some static properties of classes between my webapp and (my modified version of) memcached-session-manager. I believe with the current setup they are in separate classloaders, so sharing static resources between classes is not possible.

            That led me to bundle all the dependencies with the /WEB_INF/lib and move the the definition to /META-INF/context.xml. This is not working, with Tomcat reporting:



            Answered 2019-Jan-02 at 00:01

            memcached-session-manager (msm) jars must reside in $CATALINA_HOME/lib because they're using tomcat internal classes (which is not possible from within the webapp). More concretely, these jar are memcached-session-manager.jar, memcached-session-manager-tc7.jar and spymemcached.jar.

            The only msm related jars that must be put in /WEB_INF/lib are serialization related jars such as msm-kryo-serializer (usually defined as dependencies in your maven/gradle/xyz build), because they must be able to access application specific classes.

            See also the related msm documentation.

            Regarding your goal to share information between msm and your application: Because msm jars must reside in $CATALINA_HOME/lib, conceptually it's not possible to statically "link" application code with msm code (except msm serializer related code). This is only possible with an additional indirection: the definition of some interface inside msm, where the application provides an implementation and which msm then loads via reflection. This is how serializers are hooked into msm, see the TranscoderFactory interface (loaded from $CATALINA_HOME/lib) and the KryoTranscoderFactory implementation (loaded from /WEB_INF/lib).



            How to set up Tomcat session state in AWS EC2 for failover and security
            Asked 2017-Nov-30 at 23:36

            I am setting up a Tomcat application in EC2. For reliability, I am running two or more instances. If one server goes down, my users should be redirected to the other instance. This suggests that session state should be kept in an external source, or mirrored between the servers.

            AWS offers a hosted service, Elasticache, which seems like it would work well. I even found a nice library, memcached-session-manager. However, I soon ran into some issues.

            1. Unless someone can convince me otherwise, I need the session states to be encrypted in transit. Otherwise someone could intercept the network traffic and pretend to be someone else on my site. I don't see any built-in Amazon method to keep traffic off the internet. (Is peering available here?)
            2. The library mentioned earlier does have Redis support with SSL, but it does not support a Redis cluster. Someone put in a pull request for this but it has not been incorporated and this library is a complex build. I may talk myself into living without the cluster, but that puts us back at a single point of failure.


            Answered 2017-Nov-30 at 23:36
            1. Tomcat is running on EC2 in your VPC, and ElastiCache is in your VPC. Your AWS VPC is an isolated network. Nobody can intercept the traffic between the EC2 and Elasticache servers unless your VPC network becomes compromised in some way.

            2. If you want to use Redis instead, with SSL connections, then I believe at this time you would need a Tomcat Session Manager implementation that uses Jedis. This one uses Jedis, but you would need to upgrade the version of Jedis it uses in order to use SSL connections.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install memcached-session-manager

            Basically you must put the spymemcached jar and the memcached-session-manager jars into tomcat's lib folder. If you want to use Redis instead of memcached, you need the jar of the Redis client "jedis" instead. Additionally you must set the Manager class and add some configuration attributes. This is described in detail in the SetupAndConfiguration wiki page.


            If you want to contribute to this project you can fork this project, make your changes and submit a pull request. Or you start on the mailing list and we'll see how we can work together.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone magro/memcached-session-manager

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link