Skip to content

Commit

Permalink
add log for unsupported queue types
Browse files Browse the repository at this point in the history
  • Loading branch information
kickster97 committed Sep 26, 2024
1 parent 0603aa9 commit b9d7843
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lavinmq/queue/queue_factory.cr
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module LavinMQ
end
StreamQueue.new(vhost, frame.queue_name, frame.exclusive, frame.auto_delete, frame.arguments)
else
check_unsupported_queue_type frame
DurableQueue.new(vhost, frame.queue_name, frame.exclusive, frame.auto_delete, frame.arguments)
end
end
Expand All @@ -36,6 +37,7 @@ module LavinMQ
elsif stream_queue? frame
raise Error::PreconditionFailed.new("A stream queue cannot be non-durable")
else
check_unsupported_queue_type frame
Queue.new(vhost, frame.queue_name, frame.exclusive, frame.auto_delete, frame.arguments)
end
end
Expand All @@ -52,5 +54,11 @@ module LavinMQ
private def self.stream_queue?(frame) : Bool
frame.arguments["x-queue-type"]? == "stream"
end

private def self.check_unsupported_queue_type(frame)
if frame.arguments["x-queue-type"]?
Log.warn { "The queue type #{frame.arguments["x-queue-type"]} is not supported by LavinMQ and will revert to default" }
end
end
end
end

0 comments on commit b9d7843

Please sign in to comment.