Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kickster97 committed Oct 10, 2024
1 parent 94c550a commit bdb2d03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions spec/mqtt/integrations/unsubscribe_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,11 @@ module MqttSpecs
subscribe(io, topic_filters: topics)
disconnect(io)
end
pp "first consumers: #{server.vhosts["/"].queues["amq.mqtt-client_id"].consumers}"
sleep 1

# Publish messages that will be stored for the subscriber
2.times { |i| publish(pubio, topic: "a/b", payload: i.to_s.to_slice, qos: 0u8) }

pp "first msg count: #{server.vhosts["/"].queues["amq.mqtt-client_id"].message_count}"

# Let the subscriber connect and read the messages, but don't ack. Then unsubscribe.
# We must read the Publish packets before unsubscribe, else the "suback" will be stuck.
with_client_io(server) do |io|
Expand All @@ -73,8 +71,7 @@ module MqttSpecs
unsubscribe(io, topics: ["a/b"])
disconnect(io)
end
pp "second msg count: #{server.vhosts["/"].queues["amq.mqtt-client_id"].message_count}"
pp "unacked msgs: #{server.vhosts["/"].queues["amq.mqtt-client_id"].unacked_count}"
sleep 1

# Publish more messages
2.times { |i| publish(pubio, topic: "a/b", payload: (2 + i).to_s.to_slice, qos: 0u8) }
Expand Down
1 change: 0 additions & 1 deletion src/lavinmq/mqtt/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ module LavinMQ
end

def deliver(msg, sp, redelivered = false, recover = false)
pp "Delivering message: #{msg.inspect}"
packet_id = nil
if message_id = msg.properties.message_id
packet_id = message_id.to_u16 unless message_id.empty?
Expand Down

0 comments on commit bdb2d03

Please sign in to comment.