Types of Durables: Standard, Shared, Last-Value, Map
Each type of durable supports a different set of use cases.
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.