Skip to content

Instantly share code, notes, and snippets.

@andypiper
Created June 26, 2013 11:01
Show Gist options
  • Save andypiper/5866586 to your computer and use it in GitHub Desktop.
Save andypiper/5866586 to your computer and use it in GitHub Desktop.
Ruby script to list the topics known by an MQTT broker. These will be topics with retained messages published.
#!/usr/bin/env ruby
require 'rubygems'
require 'mqtt'
MQTT::Client.connect('localhost',1883) do |client|
client.get('#') do |topic,message|
puts "#{topic}: #{message}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment