LavinMQ::AMQP::MqttTopicExchange
Inherits LavinMQ::MQTT::Subscriber < LavinMQ::AMQP::Exchange < LavinMQ::SortableJSON < LavinMQ::Stats < LavinMQ::PolicyTarget < LavinMQ::Exchange < LavinMQ::SortableJSON < Reference < Object
Routes MQTT publishes to AMQP destinations. Queues and exchanges are bound with MQTT topic filter syntax ("a/+/c", "a/b/#"), and a delivered message's routing key is the MQTT topic verbatim.
The exchange registers itself in the vhost's SubscriptionTree, once per distinct binding key, and fans out to its own bindings on deliver.
Constructors
Instance methods
This macro will find the "bind" method of classes inheriting from this class and redefine them to raise AccessRefused exception if the first argument isn't a type in LavinMQ::AMQP namespace.
TODO remove this when LavinMQ::MQTT::Session no longer inherit from LavinMQ::AMQP::Queue and LavinMQ::MQTT::Exchange no longer inherit from lavinMQ::AMQP::Exchange
Number of bindings on this exchange. Counted cheaply, without allocating
the full bindings_details array.
No return-type restriction: AMQP exchanges return Array(AMQP::BindingDetails)
while MQTT::Exchange overrides this to return Array(MQTT::SubscriptionDetails).
A fresh Message struct: the one the tree walk hands out is shared and its delivery_mode is rewritten per entry. delivery_mode 2 is metadata only; persistence is derived from queue durability.
The tree calls this once per matching filter, so a publish matched by several filters arrives several times with the same context. It is counted in publish_in once, and in unroutable at most once. The per-publish state lives in the context, on the publishing fiber, so a publish parked in a queue's store lock is not disturbed by another client's publish into this exchange.
internal is forced true in the constructor, so ignore the flag here to keep a redeclare with internal: false idempotent.
Whether messages routed in from AMQP, e.g. dead-lettered, reach destinations. MQTT exchanges only route MQTT publishes.