RTI Connext Java API
Version 5.0.0
|
Indicates the level of reliability offered/requested by RTI Connext. More...
Public Attributes | |
ReliabilityQosPolicyKind | kind |
Kind of reliability. | |
final Duration_t | max_blocking_time |
The maximum time a writer may block on a write() call. | |
ReliabilityQosPolicyAcknowledgmentModeKind | acknowledgment_kind |
Kind of reliable acknowledgment. | |
Public Attributes inherited from QosPolicy | |
final QosPolicyId_t | id |
The ID of this QoS policy. | |
final String | policy_name |
The name of this QoS policy. | |
Additional Inherited Members | |
Public Member Functions inherited from Struct | |
abstract boolean | equals (Object obj) |
abstract int | hashCode () |
String | toString () |
Protected Member Functions inherited from Struct | |
Struct () | |
abstract void | pull_from_nativeI (long native_status) |
abstract void | push_to_nativeI (long native_status) |
Indicates the level of reliability offered/requested by RTI Connext.
This policy indicates the level of reliability requested by a com.rti.dds.subscription.DataReader or offered by a com.rti.dds.publication.DataWriter.
The reliability of a connection between a DataWriter and DataReader is entirely user configurable. It can be done on a per DataWriter/DataReader connection. A connection may be configured to be "best effort" which means that RTI Connext will not use any resources to monitor or guarantee that the data sent by a DataWriter is received by a DataReader.
For some use cases, such as the periodic update of sensor values to a GUI displaying the value to a person, com.rti.dds.infrastructure.ReliabilityQosPolicyKind.ReliabilityQosPolicyKind.BEST_EFFORT_RELIABILITY_QOS delivery is often good enough. It is certainly the fastest, most efficient, and least resource-intensive (CPU and network bandwidth) method of getting the newest/latest value for a topic from DataWriters to DataReaders. But there is no guarantee that the data sent will be received. It may be lost due to a variety of factors, including data loss by the physical transport such as wireless RF or even Ethernet.
However, there are data streams (topics) in which you want an absolute guarantee that all data sent by a DataWriter is received reliably by DataReaders. This means that RTI Connext must check whether or not data was received, and repair any data that was lost by resending a copy of the data as many times as it takes for the DataReader to receive the data. RTI Connext uses a reliability protocol configured and tuned by these QoS policies: com.rti.dds.infrastructure.HistoryQosPolicy, com.rti.dds.infrastructure.DataWriterProtocolQosPolicy, com.rti.dds.infrastructure.DataReaderProtocolQosPolicy, and com.rti.dds.infrastructure.ResourceLimitsQosPolicy.
The Reliability QoS policy is simply a switch to turn on the reliability protocol for a DataWriter/DataReader connection. The level of reliability provided by RTI Connext is determined by the configuration of the aforementioned QoS policies.
You can configure RTI Connext to deliver all data in the order they were sent (also known as absolute or strict reliability). Or, as a tradeoff for less memory, CPU, and network usage, you can choose a reduced level of reliability where only the last N values are guaranteed to be delivered reliably to DataReaders (where N is user-configurable). In the reduced level of reliability, there are no guarantees that the data sent before the last N are received. Only the last N data packets are monitored and repaired if necessary.
These levels are ordered, com.rti.dds.infrastructure.ReliabilityQosPolicyKind.ReliabilityQosPolicyKind.BEST_EFFORT_RELIABILITY_QOS < com.rti.dds.infrastructure.ReliabilityQosPolicyKind.ReliabilityQosPolicyKind.RELIABLE_RELIABILITY_QOS. A com.rti.dds.publication.DataWriter offering one level is implicitly offering all levels below.
Note: To send large data reliably, you will also need to set com.rti.dds.infrastructure.PublishModeQosPolicyKind.PublishModeQosPolicyKind.ASYNCHRONOUS_PUBLISH_MODE_QOS. Large in this context means that the data cannot be sent as a single packet by the transport (for example, data larger than 63K when using UDP/IP).
The setting of this policy has a dependency on the setting of the RESOURCE_LIMITS policy. In case the reliability kind is set to com.rti.dds.infrastructure.ReliabilityQosPolicyKind.ReliabilityQosPolicyKind.RELIABLE_RELIABILITY_QOS the write operation on the com.rti.dds.publication.DataWriter may block if the modification would cause data to be lost or else cause one of the limits in specified in the RESOURCE_LIMITS to be exceeded. Under these circumstances, the RELIABILITY max_blocking_time
configures the maximum duration the write operation may block.
If the com.rti.dds.infrastructure.ReliabilityQosPolicy.kind is set to com.rti.dds.infrastructure.ReliabilityQosPolicyKind.ReliabilityQosPolicyKind.RELIABLE_RELIABILITY_QOS, data samples originating from a single com.rti.dds.publication.DataWriter cannot be made available to the com.rti.dds.subscription.DataReader if there are previous data samples that have not been received yet due to a communication error. In other words, RTI Connext will repair the error and resend data samples as needed in order to reconstruct a correct snapshot of the com.rti.dds.publication.DataWriter history before it is accessible by the com.rti.dds.subscription.DataReader.
If the com.rti.dds.infrastructure.ReliabilityQosPolicy.kind is set to com.rti.dds.infrastructure.ReliabilityQosPolicyKind.ReliabilityQosPolicyKind.BEST_EFFORT_RELIABILITY_QOS, the service will not re-transmit missing data samples. However, for data samples originating from any one DataWriter the service will ensure they are stored in the com.rti.dds.subscription.DataReader history in the same order they originated in the com.rti.dds.publication.DataWriter. In other words, the com.rti.dds.subscription.DataReader may miss some data samples, but it will never see the value of a data object change from a newer value to an older value.
The value offered is considered compatible with the value requested if and only if:
kind
>= requested kind
evaluates to 'TRUE'. For the purposes of this inequality, the values of com.rti.dds.infrastructure.ReliabilityQosPolicy.kind are considered ordered such that com.rti.dds.infrastructure.ReliabilityQosPolicyKind.ReliabilityQosPolicyKind.BEST_EFFORT_RELIABILITY_QOS < com.rti.dds.infrastructure.ReliabilityQosPolicyKind.ReliabilityQosPolicyKind.RELIABLE_RELIABILITY_QOS. Kind of reliability.
[default] com.rti.dds.infrastructure.ReliabilityQosPolicyKind.ReliabilityQosPolicyKind.BEST_EFFORT_RELIABILITY_QOS for com.rti.dds.subscription.DataReader and com.rti.dds.topic.Topic, com.rti.dds.infrastructure.ReliabilityQosPolicyKind.ReliabilityQosPolicyKind.RELIABLE_RELIABILITY_QOS for com.rti.dds.publication.DataWriter
final Duration_t max_blocking_time |
The maximum time a writer may block on a write() call.
This setting applies only to the case where com.rti.dds.infrastructure.ReliabilityQosPolicy.kind = com.rti.dds.infrastructure.ReliabilityQosPolicyKind.ReliabilityQosPolicyKind.RELIABLE_RELIABILITY_QOS. com.rti.ndds.example.FooDataWriter.write is allowed to block if the com.rti.dds.publication.DataWriter does not have space to store the value written. Only applies to com.rti.dds.publication.DataWriter.
[default] 100 milliseconds
[range] [0,1 year] or com.rti.dds.infrastructure.Duration_t.INFINITE
ReliabilityQosPolicyAcknowledgmentModeKind acknowledgment_kind |
Kind of reliable acknowledgment.
This setting applies only to the case where com.rti.dds.infrastructure.ReliabilityQosPolicy.kind = com.rti.dds.infrastructure.ReliabilityQosPolicyKind.ReliabilityQosPolicyKind.RELIABLE_RELIABILITY_QOS.
Sets the kind acknowledgments supported by a com.rti.dds.publication.DataWriter and sent by com.rti.dds.subscription.DataReader.
[default] com.rti.dds.infrastructure.ReliabilityQosPolicyAcknowledgmentModeKind.ReliabilityQosPolicyAcknowledgmentModeKind.PROTOCOL_ACKNOWLEDGMENT_MODE