Enabling the eXtreme Scale webApp feature in the Liberty profile

[Version 8.6 and later]A Liberty profile server can host a data grid that caches data for applications to replicate HTTP session data for fault tolerance.

About this task

When you install the WebSphere® Application Server Liberty, it does not include session replication. However, if you use WebSphere eXtreme Scale with the Liberty profile, then you can replicate sessions so that if a server goes down, the application users do not lose session data.

When you add the webApp feature to the server definition and configure the session manager, you can use session replication in your eXtreme Scale applications that run in the Liberty profile.

Procedure

Add the following webApp feature to the Liberty server.xml file.
The webApp feature includes the client feature; however, it does not include the server feature. You likely want to separate your web applications from the data grids. For example, you have one Liberty server for your web applications and a different Liberty server for hosting the data grid.
<featureManager>
<feature>eXtremeScale.webapp-1.1</feature>
</featureManager>

Results

Your web applications can now persist its session data in a WebSphere eXtreme Scale grid.

Example

See the following example of a server.xml file, which contains the webApp feature that you use when you connect to the data grid remotely.
<server description="Airport Entry eXtremeScale Getting Started Client Web Server">
<!--
This sample program is provided AS IS and may be used, executed, copied and modified
without royalty payment by customer
(a) for its own instruction and study,
(b) in order to develop applications designed to run with an IBM WebSphere product,
either for customer's own internal use or for redistribution by customer, as part of such an
application, in customer's own products.
Licensed Materials - Property of IBM
5724-X67, 5655-V66 (C) COPYRIGHT International Business Machines Corp. 2012
-->
<!-- Enable features -->
<featureManager>
<feature>eXtremeScale.webapp-1.1</feature>
</featureManager>

<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="${default.http.port}"
httpsPort="${default.https.port}" />

<httpSession idReuse="true" />

<xsWebApp objectGridName="session" catalogHostPort="remoteHost:2809" securityEnabled="false" />

</server>
Note: In the example, the httpSession idReuse property is set to true. This is the recommended setting. The WebSphere eXtreme Scale reuseSessionId property is automatically synchronized with the httpSession idReuse property value. For more information on the WebSphere eXtreme Scale reuseSessionId property, see the splicer.properties file.

What to do next

The webApp feature has meta type properties that you can set on the xsWebApp element of the server.xml file. For more information, see Liberty profile xsWebApp feature properties.