WebSphere eXtreme Scale Administration Guide > Configure WebSphere eXtreme Scale > Cache integration > HTTP session management



Configure the HTTP session manager with WebSphere Application Server


While WebSphere Application Server provides session management function, this support does not scale under extreme request loads. WebSphere eXtreme Scale comes bundled with a session management implementation that overrides the default session manager for a Web container and provides better scalability and more robust configuration options.

The WebSphere eXtreme Scale HTTP session manager supports both embedded and remote servers for caching.


Embedded scenario

In the embedded scenario, the WebSphere eXtreme Scale servers are collocated in the same processes where the servlets run. The session manager can communicate directly with the local ObjectGrid instance, avoiding costly network delays.

If you are using WebSphere Application Server, place the supplied objectgridRoot/session/samples/objectGrid.xml and objectgridRoot/session/samples/objectGridDeployment.xml files into the META-INF directories of the Web archive (WAR) files. eXtreme Scale automatically detects these files when the application starts and automatically starts the eXtreme Scale containers in the same process as the session manager.

You can modify the objectGridDeployment.xml file depending on if using synchronous or asynchronous replication and how many replicas you want configured.


Remote servers scenario

In the remote servers scenario, the eXtreme Scale servers run in different processes than the servlets. The session manager communicates with a remote eXtreme Scale server. To use a remote, network-attached eXtreme Scale server, the session manager must be configured with the host names and port numbers of the eXtreme Scale catalog service cluster. The session manager then uses an eXtreme Scale client connection to communicate with the catalog server and the eXtreme Scale servers.

If the eXtreme Scale servers are to be started in independent, stand-alone processes, start the eXtreme Scale containers using the objectGridStandAlone.xml and objectGridDeploymentStandAlone.xml files that are supplied in the session manager samples directory.


Configure your application to use the eXtreme Scale HTTP session manager


Procedure

  1. WebSphere eXtreme Scale must be installed on the WebSphere Application Server or WAS ND in order to use the eXtreme Scale session Manager.

  2. Splice the application so that it can use the session manager.

    To use the session manager, add the appropriate filter declarations to the Web deployment descriptors for the application. In addition, session manager configuration parameters are passed in to the session manager in the form of servlet context initialization parameters in the deployment descriptors. There are three ways in which you can introduce this information into the application:

    • Auto-splice option

      When running in WebSphere Application Server or WebSphere Application Server Network Deployment, you do not need to manually splice the Web applications. You can add a custom property to either a cell or a server that will affect all of the Web applications at that scope. The property name is com.ibm.websphere.xs.sessionFilterProps, and you should set its value to the location of the splicer.properties file your applications require. The following is an example path for the location of a file: /opt/splicer.properties. To specify all Web applications in a cell as spliced use the administration console as follows: Go to System administration > Cell > Custom properties, and add the property there.

      To specify all of the Web applications in a given application server as use the administration console as follows: Go to Application server > <server name> > Administration > Custom properties, and add the property there.

      The cell and server scopes are the only available scopes, and only available when running in WebSphere Application Server or WebSphere Application Server Deployment Manager. If you require a different scope, you should manually splice the Web applications.

    • addObjectGridFilter script

      Use a command line script provided along with eXtreme Scale to splice an application with filter declarations and configuration in the form of servlet context initialization parameters. This script, objectgridRoot/bin/addObjectGridFilter.sh or objectgridRoot/session/bin/addObjectGridFilter.bat, takes two parameters: the application (absolute path to the enterprise archive file) that needs to be spliced, and the absolute path to the properties file that contains various configuration properties. The usage format of this script is as follows:

      [Windows]

      addObjectGridFilter.bat [location of ear file] [location of properties file]
      

      [Unix]

      addObjectGridFilter.sh [location of ear file] [location of properties file]
      

      [Unix] Example using eXtreme Scale installed on WebSphere Application Server on Unix:

      1. cd objectgridRoot/optionalLibraries/ObjectGrid/session/bin

      2. addObjectGridFilter.sh /tmp/mySessionTest.ear wasRoot/optionalLibraries/ObjectGrid/session/samples/splicer.properties

      [Unix] Example using eXtreme Scale installed in a stand-alone directory on Unix:

      1. cd objectgridRoot/session/bin

      2. addObjectGridFilter.sh /tmp/mySessionTest.ear objectgridRoot/session/samples/splicer.properties
      The servlet filter that is spliced in maintains defaults for configuration values. You can override these default values with configuration options that you specify in the properties file in the second argument. For a list of the parameters that you can use, see Servlet context initialization parameters.

      You can modify and use the sample splicer.properties file that is provided witheXtreme Scale installation. You can also use the addObjectGridServlets script, which inserts the session manager by extending each servlet. However, the recommended script is the addObjectGridFilter script.

    • Ant build script

      WebSphere eXtreme Scale ships with a build.xml file that can be used by Apache Ant, which is included in the wasRoot/bin folder of a WebSphere Application Server installation. The build.xml can be modified to change the session manager configuration properties. The configuration properties are identical to the property names in the splicer.properties file. After the build.xml has been modified, the Ant process is invoked by running ant.sh, ws_ant.sh (UNIX) or ant.bat, ws_ant.bat (Windows).

    • Update the Web descriptor manually

      Edit the web.xml file that is packaged with the Web application to incorporate the filter declaration, its servlet mapping, and servlet context initialization parameters. You should not use this method because it is prone to errors.

    For a list of the parameters that you can use, see Servlet context initialization parameters.

  3. Deploy the application. Deploy the application with the normal set of steps for a server or cluster. After you deploy the application, you can start the application.

  4. Access the application. You can now access the application, which interacts with the session manager and WebSphere eXtreme Scale.


What to do next

You can change a majority of the configuration attributes for the session manager when you instrument the application to use the session manager. These attributes include variations to the replication type (synchronous or asynchronous), session ID length, in-memory session table size and so on. Apart from the attributes that can be changed at application instrumentation time, the only other configuration attributes that you can change after the application deployment are the attributes that are related to the WebSphere eXtreme Scale server cluster topology and the way that their clients (session managers) connect to them.



Parent topic

HTTP session management


Related concepts

HTTP session management


Related tasks

Configure the HTTP session manager with WebSphere Application Server Community Edition

Related reference

Servlet context initialization parameters


+

Search Tips   |   Advanced Search