SQL/MX Queuing and Publish/Subscribe Services
Major Queuing Features
HP NonStop SQL/MX Queuing and Publish/Subscribe Services—523734-002
2-18
Nondestructive Subscribers
caught up with backlogs. To restart, the operator can start the subscribers (coded with
the AFTER LAST ROW clause) first.
Application-logic checkpointing provides another approach. To avoid reading rows, you
can subscribe with an ORDER BY clause on a unique key. When each row is returned,
write the key to a checkpoint file to checkpoint the application’s position. When
restarting the subscriber, read the key from the checkpoint file, and use it in a predicate
in the SELECT statement.
To avoid rereading rows and to catch up with rows published while the subscriber’s
cursor was closed, the unique key used in the ORDER BY clause should be an
always-increasing timestamp, and publishers should be written to update the
timestamp when inserting or updating rows.
This approach is flexible. If the application can tolerate rereading up to 100 rows, for
example, it need only checkpoint every 100 fetches.