@@ -37,6 +37,12 @@ module LavinMQ
37
37
38
38
def initialize (vhost : VHost , name : String , @retain_store : MQTT ::RetainStore )
39
39
super (vhost, name, false , false , true )
40
+ @queues = Set (LavinMQ ::Queue ).new
41
+ @exchanges = Set (LavinMQ ::Exchange ).new
42
+ end
43
+
44
+ def publish (packet : MQTT ::Publish ) : UInt32
45
+ publish(packet, @queues , @exchanges )
40
46
end
41
47
42
48
def publish (packet : MQTT ::Publish , queues : Set (LavinMQ ::Queue ), exchanges : Set (LavinMQ ::Exchange )) : UInt32
@@ -93,17 +99,6 @@ module LavinMQ
93
99
# Use only the subscription tree for all destinations (MQTT and AMQP)
94
100
end
95
101
96
- protected def find_queues_internal (routing_key , headers , queues , exchanges )
97
- @tree .each_entry(routing_key) do |destination , _ |
98
- case destination
99
- in LavinMQ ::Queue
100
- queues.add(destination)
101
- in LavinMQ ::Exchange
102
- destination.find_queues(routing_key, headers, queues, exchanges)
103
- end
104
- end
105
- end
106
-
107
102
def bind (destination : Destination , routing_key : String , arguments = nil ) : Bool
108
103
qos = arguments.try { |h | h[QOS_HEADER ]?.try(& .as(UInt8 )) } || 0 u8
109
104
binding_key = BindingKey .new(routing_key, arguments)
0 commit comments