Created
April 25, 2022 20:38
-
-
Save johanrhodin/828ff6e3f7958b448c93483f73ed072a to your computer and use it in GitHub Desktop.
Connection is left over when disk free alarm is in place
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'amqp-client' | |
require 'dotenv/load' | |
NRM = 1 | |
AMQPURL = ENV.fetch('CLOUDAMQP_URL') | |
conn = AMQP::Client.new(AMQPURL, connection_name:'leftover-connection').connect | |
ch = conn.channel | |
ch.confirm_select | |
puts "Creating queue" | |
q = ch.queue_declare("myqueue") | |
# Create NRM number of messages | |
NRM.times do |i| | |
puts "Sending message #{i}" | |
ch.basic_publish_confirm("Aloha World!", "", q.queue_name, persistent: true) | |
end | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment