Open topic with navigation

# Last-Value Durables

A last-value durable preserves only the most recent message for subscribers. It does not track message acknowledgments from subscribers.

Browsing is not supported for last-value durables and is only supported for shared durables.

## Quality of Service

A last-value durable divides its input message stream into output sub-streams based on the string value of a key field in each message. For each sub-stream, the durable stores the most recent message.

A last-value durable ensures that every new subscriber immediately receives the most recent message, if one is stored. The subscriber continues to receive the sub-stream of subsequent messages until the subscriber closes, but without any assurance of delivery.

## Message Retention

A last-value durable retains only one message for each output sub-stream. Delivery limits are not permitted for last-value durables. If message TTL is enabled, a message may be discarded once the message's age exceeds the TTL. Retention time is not permitted for last-value durables.

## Subscribers

A last-value durable can support multiple subscribers simultaneously.

Each subscriber can receive exactly one output sub-stream.

## Direct Path

Subscribers receive messages only through the persistence store. The last-value durable semantic precludes direct-path delivery, even if a direct path is configured.

## Content Matcher

Subscribing to a last-value durable requires a content matcher.

For static last-value durables, the administrator configures the key field name, and the program must match a specific value of that field in the create subscriber call.

For dynamic last-value durables, the program must supply the key field name as a property in the create subscriber call, and match a specific value of that field.

The key field must contain data of type string. Content matchers must match a string value against the key field.

Notice that each subscriber must test the key field, but each subscriber can match a different value of that field. The value determines the output sub-stream that the subscriber requests from the last-value durable.

Caution: A logical OR match is not permitted on the key field in the matcher used by a last-value durable subscriber. A subscriber must specify exactly one string value for the key field.

## Acknowledgments

A last-value durable does not track acknowledgments from subscribers.

Unlike standard and shared durables, a subscriber to a last-value durable subscriber does not consume messages from the durable. Instead, new subscribers to a sub-stream continue to receive the stored value until a publisher sends a new value, which replaces it.

## Dynamic Durable

Before a program can create a dynamic last-value durable, the administrator must have already enabled dynamic last-value dynamic durables on the endpoint. In TIBCO FTL® - Enterprise Edition Administration, see “Enabling Dynamic Durables” and “Inbox Durable Templates".

When a program creates a dynamic durable, it must supply the following information in the subscriber create call:

- Endpoint Name
- Durable Name
- Key Field Name

  When creating a new dynamic durable, the key field name becomes part of its content matcher.

- Content Matcher

  When creating a new dynamic durable, the content matcher becomes part of the new durable. The content matchers of subsequent subscribers to the durable must be identical.

If a durable with the specified durable name and key field name already exists, that durable forwards messages to the new subscriber.

If a durable with the specified durable name does not yet exist, the persistence store creates a dynamic durable using the durable name, key field name, and content matcher supplied in the subscriber create call.

For example, suppose the store does not yet contain a durable named `ticker`. A program then creates a subscriber to a last-value durable named `ticker`, with key field name `Symbol` and content matcher `{"Symbol":"IBM","Exchange":"NYSE"}`. In response, the store creates a new dynamic durable named `ticker`, with content matcher `{"Symbol":true,"Exchange":"NYSE"}`. That is, the new durable generalizes from the key field name to a content matcher clause that tests for the presence of the key field rather than a specific value, and integrates the rest of the clauses from the subscriber’s content matcher.

If the create subscriber call does not supply a content matcher, the new durable uses only the key field clause as its content matcher.

Subsequent subscribers to the durable must specify compatible content matchers: that is, they must be identical except for the key field value, which can be different. A subscriber create call with an incompatible content matcher throws an exception.

## Static Durable

Before a program can subscribe to a static durable, the administrator must have already defined that durable in the persistence store associated with the endpoint. See “Defining a Static Durable” in TIBCO FTL® - Enterprise Edition Administration.

When a program subscribes to a static last-value durable, it must supply the following information in the subscriber create call:

- Endpoint Name
- Durable Name or Subscriber Name

  To understand this distinction, see “Durable Subscribers” in TIBCO FTL Development.

- Content Matcher

  The content matcher must include a test for a specific value of the key field: that is, it must express interest in a sub-stream of the last-value durable, as determined by a specific key string.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO FTL® - Enterprise Edition

Copyright © 2009-2024. Cloud Software Group, Inc. All Rights Reserved.