Expand description
MQTT 5 broker implementation for RustStream, built on rumqttc.
Handlers, routers, codecs, and middleware come from the framework; this crate supplies
the transport over rumqttc, targeting MQTT 5 because two
things the framework relies on exist only there: user properties (headers travel natively
instead of through an invented envelope) and shared subscriptions (competing consumers
are expressible at all).
- The crate owns a connection task that drives the client’s single event loop, demultiplexes packets to per-subscription streams by topic-filter matching, reconnects with backoff, and resubscribes when the broker reports the session gone - all without ever stalling keep-alive traffic.
- Acknowledgement follows the quality of service:
QoS1/2 acknowledge through the protocol under manual control;QoS0 reportsAckError::Unsupportedrather than pretending, as doesnack(requeue = true)- MQTT has no negative acknowledgement, and unacked messages redeliver when a persistent session resumes. - Retained messages, last will, session persistence, and TLS with client certificates are configuration on the broker and the publish policy.
Structs§
- Connected
Mqtt Broker - The typed witness that
connectsucceeded: holds the live client directly. - Mqtt
Broker - An MQTT 5 broker for the
RustStreammessaging framework. - Mqtt
Message - A message delivered by an
MqttSubscriber. - Mqtt
Publish - The publish policy for
MqttPublisher: quality of service and the retain flag as pure declaration, paired with the connected broker by the runtime afterconnect. - Mqtt
Publisher - Publishes messages to MQTT topics through the shared connection.
- Mqtt
Subscriber - A subscription to one MQTT topic filter; yields
MqttMessages. - Mqtt
Topic - A subscription descriptor for one MQTT topic filter.