|QuickStart Examples / Reliable Event Notification Examples|
With durable messaging configured for a client, servers save specified events in queue while the client is disconnected and then play them back when the client reconnects.
You can select which continuous queries or interest registrations are durable, so the server only queues events you really need to retain if your client goes down.
In one session, start the server:
$ java quickstart.DurableServer
In another session, start the durable client:
$ java quickstart.DurableClient
After the client starts, press Enter in the server session once or twice to see the events arrive at the client side.
Press Enter in the client session to exit the client application.
When the client is stopped, in the server session, press Enter twice to create new events.
Restart the client application.
You see the events that the server stored for the durable interest played back to the client.
Press Enter to exit the client again.
Type exit and press Enter to exit the server.
Program and cache configuration source files for the client and server, including the listener declared in the client and server xml files.
|DurableServer.xml||Configures a cache to serve Durable caching clients. The example region also is configured with a loader and listener.|
|DurableClient.xml||Configures a region as a client region in a Durable cache.|
|DurableServer.java||The server to which the DurableClient connects|
|DurableClient.java||The client that connects to the DurableServer.java.|
|SimpleCacheListener.java||A CacheListener that reports cache events.|