The purpose of this QoS is to avoid delivering stale data to the application by specifying how long the data written by a DataWriter is considered valid.

Each data sample written by a DataWriter has an associated expiration time beyond which the data should not be delivered to any application. Once the sample expires, the data will be removed from the DataWriter and DataReader caches.

The expiration time of each sample from the DataWriter's cache is computed by adding the duration specified by this QoS policy to the time when the sample is added to the DataWriter's cache. This timestamp is not necessarily equal to the sample's source timestamp that can be provided by the user using the DataWriter's write_w_timestamp() or write_w_params() APIs.

The expiration time of each sample from the DataReader's cache is computed by adding the duration to the reception timestamp.

The Lifespan QosPolicy can be used to control how much data is stored by Connext DDS. Even if it is configured to store "all" of the data sent or received for a topic (see the HISTORY QosPolicy), the total amount of data it stores may be limited by the Lifespan QosPolicy.

You may also use the Lifespan QosPolicy to ensure that applications do not receive or act on data, commands or messages that are too old and have "expired.”

It includes the single member listed in DDS_LifespanQosPolicy. For the default and valid range, please refer to the API Reference HTML documentation.



Field Name




Maximum duration for the data's validity.

Although you can set the LIFESPAN QosPolicy on Topics, its value can only be used to initialize the LIFESPAN QosPolicies of DataWriters. The Topic’s setting for this QosPolicy does not directly affect the operation of Connext DDS, see Setting Topic QosPolicies.


This QoS policy can be modified after the entity is enabled.

It does not apply to DataReaders, so there is no requirement that the publishing and subscribing sides use compatible values.

Related QoS Policies

Applicable Entities

System Resource Considerations

The use of this policy does not significantly impact the use of resources.

© 2018 RTI