Deploying the REST gateway

Before you begin

Verify that a Liberty profile server is created. For more information, see Installing the Liberty profile.

About this task

The REST gateway is a servlet that is defined in the wxsRESTGateway.war web archive (WAR) file. With this REST gateway, you use a Uniform Resource Identifier (URI) to access data in the data grid.

Procedure

  1. Enable the REST gateway feature by either manually editing the server.xml file or by using the Liberty Profile Developer Tools.
    • Enable the REST gateway in the Liberty profile server.xml file.
      <featureManager>
        <feature>eXtremeScale.rest-1.1</feature>
      </featureManager>
    • Enable the REST gateway in the Liberty profile server.xml file using Liberty Profile Developer Tools.
      • Start IBM®WebSphere® Application Server Version 8.6 Liberty Profile Developer Tools.
      • In the Design tab, select Feature Manager. Click Add in the Feature Manager Details section. Select and add the eXtremeScale.rest-1.1 feature.
      • With the Feature Manager selected, click Add in the Feature Manager Details section. Select and add the servlet-3.0 feature.
      • Save the server.xml file.
    • Enable the REST gateway in WebSphere Application Server.
  2. Configure the REST gateway.
    1. Configure the REST gateway in the server.xml file. Enter the following line of code:
      <xsREST contextRoot=”myContextRoot” remoteDomain=”myDomain”/>
      Attention: The attributes, contextRoot and remoteDomain, are optional. The default content root is resources.
    2. Configure an eXtreme Scale server.
    3. Configure a container service.
      The following options are available to configure a container service:
      • Copy a valid objectgrid.xml file (with or without an accompanying objectGridDeployment.xml file) into the wlp_home/usr/servers/server_name/grids directory. This grids directory is monitored by the product at run time. Changes to files in this directory initiate events in the Liberty profile runtime environment. For example, when new objectgrid.xml, objectGridDeployment.xml, or both files are found, a new container server is created. When one of these files are deleted, eXtreme Scale stops that container server. When files are modified, eXtreme Scale stops and restarts the container. Multiple shard containers can exist in the same eXtreme Scale server, which requires that subdirectories exist inside the grids directory.
  3. Start the Liberty profile server to run the REST client gateway.

What to do next

When the REST gateway is enabled, anyone with access to the servlet can access data in a data grid. Therefore, you must use web application security in WebSphere Application Server to control authorization. For more information about securing your web applications that use this REST gateway, see Securing web applications in the WebSphere Application Server Information Center.

The wxsRESTGateway.war file, which contains the web.xml file for the security configuration is in the following locations, depending on your installation:
  • wlp_install_root/wxs/web/rest
  • was_install_root/optionalLibraries/ObjectGrid/restgateway
  • wxs_standalone_install_root/ObjectGrid/restgateway

You can now begin using the REST data service in the Liberty profile to communicate with the data grid through a URI. For more information, see Developing data grid applications with the REST gateway.