Skip to main content

QoS Cheatsheet

Quick reference for HDDS QoS policies and the fluent builder API.

Data Distribution

PolicyValuesDefaultCompatibility
Reliabilitybest_effort(), reliable()best_effortExact match
Historykeep_last(N), keep_all()keep_last(100)N/A
Durabilityvolatile(), transient_local(), persistent()volatileWriter >= Reader
ResourceLimitsmax_samples, max_instances, max_quota_bytesUnlimitedN/A

Timing

PolicyValuesDefaultCompatibility
Deadlinedeadline(Duration)InfiniteWriter ≤ Reader
Lifespanlifespan(Duration)InfiniteWriter >= Reader

Lifecycle

PolicyValuesDefaultCompatibility
Livelinessliveliness_automatic(), liveliness_manual_by_participant(), liveliness_manual_by_topic()AutomaticWriter >= Reader

Common Profiles

Sensor Streaming (High Rate)

use hdds::QoS;

let qos = QoS::best_effort().keep_last(1).volatile();

State Synchronization

use hdds::QoS;

let qos = QoS::reliable().keep_last(10).transient_local();

Command Queue

use hdds::QoS;

let qos = QoS::reliable().keep_all();

Event Log

use hdds::QoS;

let qos = QoS::reliable().keep_all().persistent();

Full Example

use hdds::{Participant, QoS, TransportMode};

let participant = Participant::builder("example_app")
.domain_id(0)
.with_transport(TransportMode::UdpMulticast)
.build()?;

let topic = participant.topic::<SensorData>("sensors/data")?;

// Writer with reliable QoS
let writer = topic
.writer()
.qos(QoS::reliable().keep_last(100).transient_local())
.build()?;

// Reader with reliable QoS
let reader = topic
.reader()
.qos(QoS::reliable().keep_last(50))
.build()?;

Compatibility Matrix

Reliability

WriterReaderMatch
reliable()reliable()
reliable()best_effort()
best_effort()best_effort()
best_effort()reliable()

Durability

WriterReaderMatch
persistent()Any
transient_local()transient_local()/volatile()
transient_local()persistent()
volatile()volatile()
volatile()transient_local()/persistent()

Liveliness

WriterReaderMatch
manual_by_topicAny
manual_by_participantmanual_by_participant/automatic
manual_by_participantmanual_by_topic
automaticautomatic
automaticmanual_*

Fluent Builder API

Available Methods

MethodDescription
QoS::reliable()Guaranteed delivery with ACK/NACK
QoS::best_effort()Fire and forget, lowest latency
.keep_last(n)Keep last N samples per instance
.keep_all()Keep all samples (bounded by ResourceLimits)
.volatile()No persistence
.transient_local()In-memory cache for late joiners
.persistent()Disk persistence
.deadline(Duration)Maximum time between samples
.liveliness_automatic(Duration)DDS manages liveness assertions
.liveliness_manual_by_participant(Duration)Application asserts per participant
.liveliness_manual_by_topic(Duration)Application asserts per writer

See Also