class

LavinMQ::DefinitionsStore

Inherits Reference < Object

Constants

Log = LavinMQ::Log.for("definitions_store")

Constructors

new(vhost : VHost, data_dir : String, replicator : Clustering::Replicator | Nil, log : Logger)
Source

Class methods

delayed_mqtt_topic?(type : String, arguments : AMQP::Table) : Bool

An x-mqtt-topic exchange only routes MQTT publishes, which can't carry an x-delay, so it would ignore x-delayed-exchange and only look delayed. Any value but false is refused, not only true, since the intent is clear.

Source

Instance methods

apply(f, loading = false, fsync = true) : Bool

ameba:disable Metrics/CyclomaticComplexity

Source
close
Source
each_exchange
Source
each_queue
Source
each_session
Source
exchange(name : String) : Exchange
Source
exchange?(name : String) : Exchange | Nil
Source
exchange_exists?(name : String) : Bool
Source
exchanges
Source
exchanges_any?
Source
exchanges_size
Source
fsync

Flush buffered definition writes to disk. Used after a bulk operation (e.g. import) that stored its definitions with fsync: false; the whole batch is acknowledged after this, so it waits for follower acks like the per-frame path does.

Source
load!

ameba:disable Metrics/CyclomaticComplexity

Source
mqtt_exchange

The vhost's MQTT exchange. Created with the store rather than declared, so that it's always there when frames are applied — bindings with it as source would be dropped otherwise. It isn't durable, which is what keeps it out of the definitions file.

Source
queue(name : String) : AMQP::Queue
Source
queue?(name : String) : AMQP::Queue | Nil
Source
queue_bindings(queue : Queue)
Source
queue_exists?(name : String) : Bool
Source
queues
Source
queues_clear
Source
queues_size
Source
register_exchange(exchange : Exchange) : Nil

Insert a pre-built exchange (e.g. MQTT or other internal types that the frame-driven apply path can't construct). Locked; idempotent so callers like init_delayed_queue can re-register on exchange re-creation. Skips persistence and event ticks since these aren't replayed from frames.

Source
register_queue(queue : AMQP::Queue) : Nil

Insert a pre-built queue (e.g. DelayedExchangeQueue) that the frame-driven apply path can't construct. Locked; idempotent so it can be called when an exchange is re-imported and a delayed queue with the same name already exists. Skips persistence and event ticks since these aren't replayed from frames.

Source
session(name : String) : MQTT::Session
Source
session?(name : String) : MQTT::Session | Nil
Source
session_exists?(name : String) : Bool
Source
sessions
Source
sessions_clear
Source
sessions_size
Source
synchronize
Source