Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add log for unsupported queue types #792

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
warn_if_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
warn_if_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.warn_if_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 be changed to the default queue type" }
end
end
end
end
Loading