Basic Definitions for Persistence
A durable can exhibit one of these behavior types: standard, shared, last-value, or map (see the definitions that follow).
Independent of its behavior type, a durable can exist either as static or dynamic (see the definitions that follow).
Use a standard durable when a subscriber must receive every message in a message stream, even if the subscriber is intermittently disconnected from the message bus. The type of persistence for a standard durable depends on whether the prefetch feature is enabled or disabled:
- Prefetch Enabled — Messages are received and sent by the server to subscribers. The durable functions as a message broker, with no messages traveling peer-to-peer from publisher to subscriber.
- Prefetch Disabled — Under normal conditions, messages flow directly from publisher to subscriber, with the store serving as a backup.
Use a shared durable when a set of subscribers collectively process a message stream in a distributed or parallel fashion, processing every message exactly once.
Use a last-value durable to hold recent context for initializing new subscribers.
Applications can use the map API to get the current value of a key, or to store a key/value pair.
Key values must be strings.
Dynamic durables are more convenient than static durables. Use static durables in situations that require administrative control over durables, or to support existing applications.