Caching sessions in your application is one of the most beneficial and easy to do to improve performance that you can do. If you have the Liberty Profile, store your information in your sessions, and want to offload that to a cache which can be hit over and over again at super fast speeds, try out this sample.

Downloads

The Websphere eXtreme Scale HTTP Session Sample is a web application and documentation provided to demonstrate the functionality of the Websphere eXtreme Scale Version 8.6 HTTP session management component. This document will show you exactly how to configure WebSphere Liberty Profile to integrate WebSphere eXtreme Scale on the XC10 DataPower Appliance as an HTTP Session caching provider.

It's as easy as adding the eXtremeScale.webapp feature with a little configuration to connect to your XC10 appliance.

The sample covers topics such as Setup, Usage, Failover, Configuration and Troubleshooting. Also included is source code to follow along and try out writing a sample Web Application that uses the HTTP Session cache.

Connect to an eXtreme Scale data grid in your application with the WebSphere eXtreme Scale Resource Adapter using the Java Transaction API (JTA). This sample will show you how to install the resource adapter, configure a connection factory and code samples to connect and add or retrieve objects from your data grid.

Downloads

Software Requirements

Running the sample

Read the readme.html file located in the downloaded sample file to complete instructions on how to install, configure and run the sample. You need only install the eXtreme Scale Client for WAS 7 or WAS 8 in this example to connect to an XC10 Appliance.

This application is required for you to use the wxsra.ra resource adapter. You can find it located in the was_install_root/optionalLibrairies/ObjectGrid directory when eXtreme Scale is installed on a WebSphere Application Server installation. Navigate to the was_install_root/ObjectGrid/lib directory for a stand-alone installation.

Picture this, you have a business that is selling those wildly popular tablets, and you want to know when you need to order more. With continuous query, you will actually be notified this is happening in your grid if you setup the correct query saying, let me know when quantity is < 10. You can then send off a task to get more in stock, upgrade the value in the grid to out of stock, or increase the price! This gives you the power to react to what's happening without having to watch mounds of data trying to figure out what is going on.

The getting started with Continuous Query sample is provided for a quick introduction to the Continuous Query filtering. It consists of shell and batch scripts designed to start a simple grid with very little customization needed. The sample shows how to filter results automatically with WebSphere eXtreme Scale data grid. Add this to your XC10 Appliance, and you have a quick way to automatically be notified what's in your grid so that your application can react appropriately.

Downloads

Running the sample as a client for XC10
------------------
1. Create a Simple Data Grid and Map on the XC10 console
Sign into the console
Click Data Grid->Simple Data Grid
Click the plus sign for a new Grid.
Give the Grid a Name.

2. Edit your env.bat or env.sh
Change the CATALOGSERVER_HOST and CATALOGSERVER_PORT to point to your XC10 machine.
Change the CATALOG_SERVICE_ENDPOINTS to point to your XC10 machine.
Change the GRID_NAME, MAP_NAME and COORD_MAP_NAME to what you gave your Grid Name.
An example would be GRID_NAME = Grid
MAP_NAME = Grid.CT
COORD_MAP_NAME = Grid.NONE

6. In another terminal, in the same directory, <installRoot>/ObjectGrid/samples/ContinuousQuerySample run the Worker test:

Windows: runclient.bat worker
UNIX: ./runclient.sh worker

The filter client will define a continuous query that should find anyone with first name Larry. As soon as the
worker client inserts this object into the grid, the filter finds it and prints it out.

The cache now contains the one existing customer named Larry.
Customer: lastName=Bird;firstName=Larry;age=36;wearGlasses=true;lastPurchased=1351007933531;

Walk through the code and demo output to see more examples of the continuous query feature.

For information on loading and running this client in Eclipse,
refer to the provided ECLIPSE_README.txt file. You can use the Eclipse environment
to update and compile the sample and run the sample programmatically.

The getting started samples are provided for a quick introduction to eXtreme Scale functionality and basic operation in an IIS environment, specifically running in Visual Studio.

The samples consist of an ASP based client application, including source, is provided to run simple create, read, update, and delete (CRUD) functions to this basic grid. The client application can also be used to run simple create, read, update and delete functions to a simple grid hosted on a WebSphere DataPower XC10 appliance. To get started even quicker, download the XC10 Virtual Appliance.

Before importing and running the sample application, you must perform a full installation of WebSphere eXtreme Scale to start a grid. You then will require to install the WebSphere eXtreme Scale Client for .NET.

Importing the sample into Visual Studio

You should now see the solution in your Solution Explorer. If there are build errors, then you must resolve them by adding the eXtreme Scale DLL files as References, as described in the following steps:

The correct references are now in the solution, you should be able to compile and build your solution.

Open Visual Studio

From the File menu, select Open, Project/Solution...

Browse to the directory of the downloaded sample, select IBM.WebSphere.caching.GettingStartedWeb.sln file, and click Okay.

Expand the GettingStartedWeb solution, and then expand References.

If IBM.WebSphere.Caching.dll is not resolved, you can remove it and add it where it is located on your machine.

Right click References, Add Reference....

Select the Browse tab. Look in the eXtreme Scale Client for .NET install/bin directory for IBM.WebSphere.Caching.dll and click Okay. You cannot have two of the same named references, so if you did not delete the one that came with the solution to add your new reference, please remove it first.

Running the client application

The client application is a simple ObjectGrid client that connects to a remote or embedded ObjectGrid and performs Create, Read, Update and Delete (CRUD) operations. This client can be used with a WebSphere eXtreme Scale grid or a simple grid on a WebSphere DataPower XC10 appliance.

After you have imported your solution file into Visual Studio, you can then build it and run the application on the IIS Server that comes with Visual Studio.

From the menu, select Build, Build Solution to compile.

Then to run the compiled code on the IIS Server, select Debug, Start Debugging.

In the Client Connection section, enter the hostname or IP address and port of the Remote catalog service endpoint in the form of hostname:port.

In the Grid name and Map name fields, enter the names of the target grid and map. The default for the Server servlet application provided is Grid for the grid name and Map1 for the map name. If you are using this client with an XC10 appliance, you must first create a simple grid on the XC10 appliance. Use the name of the simple grid for both the grid name and the map name.

After entering the catalog service endpoint, gridname, and mapname, click Connect to test the connection. If the connection is successful, you will see true for Client Connected.

Enter a string value for Key and a string value for Value. Then, select the appropriate CRUD operation; either Add, Replace, Remove, or Get.

You can also now download the documentation for offline use. For an offline copy of the full documentation, including the API documentation, install a copy of the Eclipse help system and then deploy the documentation plug-ins to the server. The V8.6.0.2 and V2.5 documentation is available for offline use. If you need a different version of the documentation, let us know in the comments and we can work on making it available for you. For information about how to set up the offline documentation, see Using the documentation offline.