Skip to content

Commit d9733c0

Browse files
authored
refactor: Only use AMQP::Queue and AMQP::Exchange in dead lettering (#1679)
1 parent 016747d commit d9733c0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/lavinmq/amqp/argument/dead_lettering.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module LavinMQ::AMQP
4545
def route(msg : BytesMessage, reason) # ameba:disable Metrics/CyclomaticComplexity
4646
# No dead letter exchange => nothing to do
4747
return unless dlx = (msg.dlx || dlx())
48-
ex = @vhost.exchanges[dlx.to_s]? || return
48+
ex = @vhost.exchanges[dlx.to_s]?.as?(AMQP::Exchange) || return
4949

5050
dlrk = msg.dlrk || dlrk()
5151

@@ -67,7 +67,7 @@ module LavinMQ::AMQP
6767
# cycle detection and to not create a lot of faulty stats.
6868
# This means that no delay, consistent hash check or such is performed
6969
# if the dead letter exchange has any of these features enabled.
70-
queues = Set(LavinMQ::Queue).new
70+
queues = Set(AMQP::Queue).new
7171
ex.find_queues(routing_rk, routing_headers, queues)
7272
return if queues.empty?
7373

0 commit comments

Comments
 (0)