Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BookmarkStore

This is the interface for the classes that represent a bookmark store. Bookmark store is used by the Client to provide resumable subscriptions and client-side duplicate message handling.

Hierarchy

  • BookmarkStore

Implemented by

Index

Methods

discard

  • discard(message: Message): void
  • discard(subId: string, bookmark: string): void
  • 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 subcription resumes.

    Parameters

    • message: Message

      The message object.

    Returns void


  • 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 subcription resumes.

    Parameters

    • subId: string

      The subscription id.

    • bookmark: string

      The raw bookmark field value of a message.

    Returns void

isDiscarded

  • isDiscarded(message: Message): boolean
  • 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.

    Parameters

    • message: Message

      The message to check.

    Returns boolean

    true if the bookmark is in the log and marked as discarded and should therefore not be reprocessed. Otherwise, returns false.

log

  • log(message: Message): BigInteger
  • This method is called internally by the Client to log a bookmark to the persistent log.

    Parameters

    • message: Message

      the message to bookmark.

    Returns BigInteger

    The corresponding bookmark sequence number for this bookmark.

mostRecent

  • mostRecent(subId: string): string
  • This method is called when you want to return the most recent bookmark from the log that ought to be used for (re-)subscriptions.

    Parameters

    • subId: string

      The subscription id.

    Returns string

    The most recent bookmark.

oldestBookmarkSeq

  • oldestBookmarkSeq(subId: string): BigInteger
  • This method is called when you want to retrieve the sequence number of the oldest bookmark in the store.

    Parameters

    • subId: string

      The identifier of the subscription.

    Returns BigInteger

    The sequence nubmer of the oldest bookmark in the store.

persisted

  • persisted(subId: string, bookmark: string): void
  • This method is called internally by the Client to mark a message as safely persisted by AMPS to all of its sync replication destinations.

    Parameters

    • subId: string

      The identifier of the subscription.

    • bookmark: string

      A raw bookmark string.

    Returns void

purge

  • purge(subId: string): void
  • 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.

    Parameters

    • subId: string

      The identifier of the subscription to purge.

    Returns void