12.5. Test Replication on the Application

Use the following instructions to test that cache entries are replicating from the first server instance to the second as desired.

Procedure 12.4. Test Replication on the Application

  1. Access the First Server

    Access the first application server and enter the key and value.
    1. Access the first application server in a browser window using the following URL:
      http://localhost:8080/jboss-helloworld-jdg
    2. Insert the key foo.
    3. Insert the value bar.
  2. Access the Second Server

    Access the second application server and enter the key and value.
    1. Access the second application server in a browser window using the following URL:
      http://localhost:8180/jboss-helloworld-jdg
    2. Click Get Some.
    3. Get the key foo.
    4. Click Put Some More.
    5. Insert the key mykey.
    6. Insert the value myvalue.
  3. Get All Keys and Values

    Access the first server and request all keys.
    1. Access the first application server in a browser window using the following URL:
      http://localhost:8080/jboss-helloworld-jdg
    2. Click Get Some.
    3. Click Get All to request all key and values.
Result

As the results of the last step show, all the data added at each server has been replicated to the other server.

Note

Entries expire after 60 seconds from the most recent update.
Directly Access Keys in the Cache

To interact with predefined servlets or to directly store and retrieve keys from the cache, use the following URLs:

http://localhost:8080/jboss-helloworld-jdg/TestServletPut
http://localhost:8180/jboss-helloworld-jdg/TestServletGet