This method is called when you want to mark the message object as discarded, indicating that the application has completed processing the message. Marking a message as discarded means that the message will not be replayed when the subscription resumes.
The message object.
This method is called when you want to mark the message specified by the subscription ID and the bookmark sequence number as discarded, indicating that the application has completed processing the message. Marking a message as discarded means that the message will not be replayed when the subscription resumes.
The subscription id.
The bookmark sequence in the store.
This method is called for each arriving message to determine if the application has already processed and discarded this message. Returns 'true' if the bookmark is in the log and marked as discarded and should therefore not be reprocessed. Otherwise, returns 'false'. Generally, isDiscarded is called by the Client however, if needed it can be called by the application as well.
The message to check.
true
if the bookmark is in the log and marked as discarded and should therefore
not be reprocessed. Otherwise, returns false
.
This method is called when you want to return the most recent bookmark from the log that ought to be used for (re-)subscriptions.
The subscription id.
The most recent bookmark.
This method is called when you want to retrieve the sequence of the oldest bookmark in the store.
The identifier of the subscription.
The sequence number of the oldest bookmark in the store. 0 if not found/doesn't exist
This method is called internally by the Client to mark a message as safely persisted by AMPS to all of its sync replication destinations.
The identifier of the subscription.
A bookmark field object.
This method is called when you want to purge the contents of this store. If the subId is not provided, removes any tracking history associated with publishers and received messages. Otherwise, removes history for that subId only.
The identifier of the subscription to purge.
Bookmark store is used by the Client to provide resumable subscriptions and client-side duplicate message handling using in-memory storage.
// create the bookmark store var bookmarkStore = new amps.MemoryBookmarkStore(); // create the client instance and assign the bookmark store to it var client = new amps.Client('my-client'); client.bookmarkStore(bookmarkStore); // ... access the bookmark store later client.bookmarkStore().purge();