RTI Connext Java API Version 7.1.0
|
Specifies and configures the mechanism that allows com.rti.dds.subscription.DataReader entities to detect when com.rti.dds.publication.DataWriter entities become disconnected or "dead.". More...
Public Attributes | |
LivelinessQosPolicyKind | kind |
The kind of liveliness desired. More... | |
final Duration_t | lease_duration |
The duration within which a com.rti.dds.publication.DataWriter must be asserted, or else it is assumed to be not alive. More... | |
int | assertions_per_lease_duration |
The number of assertions a com.rti.dds.publication.DataWriter will send during a its com.rti.dds.infrastructure.LivelinessQosPolicy.lease_duration. More... | |
![]() | |
final QosPolicyId_t | id |
The ID of this QoS policy. More... | |
final String | policy_name |
The name of this QoS policy. More... | |
Specifies and configures the mechanism that allows com.rti.dds.subscription.DataReader entities to detect when com.rti.dds.publication.DataWriter entities become disconnected or "dead.".
The liveliness status of a com.rti.dds.publication.DataWriter is used to maintain instance ownership in combination with the setting of the OWNERSHIP policy. The application is also informed via com.rti.dds.infrastructure.Listener when an com.rti.dds.publication.DataWriter is no longer alive.
A com.rti.dds.publication.DataWriter commits to signalling its liveliness at intervals not to exceed the com.rti.dds.infrastructure.LivelinessQosPolicy.lease_duration configured on the com.rti.dds.publication.DataWriter. The rate at which the com.rti.dds.publication.DataWriter will signal its liveliness is defined by com.rti.dds.infrastructure.LivelinessQosPolicy.assertions_per_lease_duration.
The com.rti.dds.subscription.DataReader lease_duration specifies the maximum period at which matching DataWriters must have their liveliness asserted.
In addition, in the subscribing application Connext DDS uses an internal thread that wakes up at the period set by the DataReader's lease_duration to see if a DataWriter lease_duration has been violated.
Important: A DataReader will consider a DataWriter not alive if the DataWriter does not assert its liveliness within the DataWriter lease_duration not the DataReader lease_duration.
Listeners are used to notify a com.rti.dds.subscription.DataReader of loss of liveliness and com.rti.dds.publication.DataWriter of violations to the liveliness contract. The on_liveliness_lost() callback is only called once, after the first time the lease_duration is exceeded (when the com.rti.dds.publication.DataWriter first loses liveliness).
This QoS policy can be used during system integration to ensure that applications have been coded to meet design specifications. It can also be used during runtime to detect when systems are performing outside of design specifications. Receiving applications can take appropriate actions in response to disconnected DataWriters.
This policy controls the mechanism and parameters used by RTI Connext to ensure that particular DataWriters on the network are still alive. The liveliness can also affect the ownership of a particular instance, as determined by the OWNERSHIP policy.
This policy has several settings to support both data types that are updated periodically as well as those that are changed sporadically. It also allows customisation for different application requirements in terms of the kinds of failures that will be detected by the liveliness mechanism.
The com.rti.dds.infrastructure.LivelinessQosPolicyKind.LivelinessQosPolicyKind.AUTOMATIC_LIVELINESS_QOS liveliness setting is most appropriate for applications that only need to detect failures at the process-level, but not application-logic failures within a process. RTI Connext takes responsibility for renewing the leases at the required rates and thus, as long as the local process where a com.rti.dds.domain.DomainParticipant is running and the link connecting it to remote participants remains connected, the entities within the com.rti.dds.domain.DomainParticipant will be considered alive. This requires the lowest overhead.
The manual settings (com.rti.dds.infrastructure.LivelinessQosPolicyKind.LivelinessQosPolicyKind.MANUAL_BY_PARTICIPANT_LIVELINESS_QOS, com.rti.dds.infrastructure.LivelinessQosPolicyKind.LivelinessQosPolicyKind.MANUAL_BY_TOPIC_LIVELINESS_QOS) require the application on the publishing side to periodically assert the liveliness before the lease expires to indicate the corresponding com.rti.dds.infrastructure.Entity is still alive. The action can be explicit by calling the com.rti.dds.publication.DataWriter.assert_liveliness operation or implicit by writing some data.
The two possible manual settings control the granularity at which the application must assert liveliness.
Changes in LIVELINESS must be detected by the Service with a time-granularity greater or equal to the com.rti.dds.infrastructure.LivelinessQosPolicy.lease_duration. This ensures that the value of the com.rti.dds.subscription.LivelinessChangedStatus is updated at least once during each lease_duration and the related Listeners and com.rti.dds.infrastructure.WaitSet s are notified within a lease_duration from the time the LIVELINESS changed.
The value offered is considered compatible with the value requested if and only if the following conditions are met:
lease_duration
<= requested lease_duration
evaluates to com.rti.dds.infrastructure.true. The kind of liveliness desired.
[default] com.rti.dds.infrastructure.LivelinessQosPolicyKind.LivelinessQosPolicyKind.AUTOMATIC_LIVELINESS_QOS
final Duration_t lease_duration |
The duration within which a com.rti.dds.publication.DataWriter must be asserted, or else it is assumed to be not alive.
For a DataWriter, the lease_duration specifies a timeout by which liveliness must be asserted for the DataWriter or the DataWriter will be considered inactive or not alive.
For a DataReader, the lease_duration specifies the maximum period at which the DataReader will check to see if the matching DataWriters are still alive according to the DataWriters lease_duration value.
Important: A DataReader will consider a DataWriter not alive if it does not assert its liveliness within the DataWriter lease_duration not the DataReader lease_duration.
[default] com.rti.dds.infrastructure.Duration_t.DURATION_INFINITE
[range] [0,1 year] or com.rti.dds.infrastructure.Duration_t.DURATION_INFINITE
int assertions_per_lease_duration |
The number of assertions a com.rti.dds.publication.DataWriter will send during a its com.rti.dds.infrastructure.LivelinessQosPolicy.lease_duration.
This field only applies to a com.rti.dds.publication.DataWriter and is not considered during QoS compatibility checks.
The default value is 3. A higher value will make the liveliness mechanism more robust against packet losses, but it will also increase the network traffic.
[default] 3
[range] [2, 100 million]