class ExampleTopicConsumer
Example topic consumer.
Public Class Methods
new()
click to toggle source
Initialize.
# File examples/topic_consumer.rb, line 9 def initialize end
Public Instance Methods
run()
click to toggle source
Run example.
# File examples/topic_consumer.rb, line 12 def run client = Stomp::Client.new("failover://(stomp://:@localhost:61613,stomp://:@remotehost:61613)?initialReconnectDelay=5000&randomize=false&useExponentialBackOff=false") puts "Subscribing to /topic/ronaldo" client.subscribe("/topic/ronaldo") do |msg| puts msg.to_s puts "----------------" end loop do sleep(1) puts "." end end