Sha256: e83083da8d2bc2f183325c30ad1fa5a663cbc407cc36068637303cd3f3d21aec

Contents?: true

Size: 607 Bytes

Versions: 34

Compression:

Stored size: 607 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'rubygems'
require 'stomp'
#
# == Example topic consumer.
#
class ExampleTopicConsumer
  # Initialize.
  def initialize
  end
  # Run example.
  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
end
#
e = ExampleTopicConsumer.new
e.run

Version data entries

34 entries across 32 versions & 2 rubygems

Version Path
stomp-1.4.10 examples/historical/topic_consumer.rb
stomp-1.4.9 examples/historical/topic_consumer.rb
stomp-1.4.8 examples/historical/topic_consumer.rb
stomp-1.4.7 examples/historical/topic_consumer.rb
stomp-1.4.6 examples/historical/topic_consumer.rb
stomp-1.4.5 examples/historical/topic_consumer.rb
stomp-1.4.4 examples/topic_consumer.rb
stomp-1.4.3 examples/topic_consumer.rb
stomp-1.4.2 examples/topic_consumer.rb
stomp-1.4.1 examples/topic_consumer.rb
stomp-1.4.0 examples/topic_consumer.rb
stomp-1.3.5 examples/topic_consumer.rb
stomp-1.3.4 examples/topic_consumer.rb
stomp-1.3.3 examples/topic_consumer.rb
stomp-1.3.2 examples/topic_consumer.rb
stomp-1.3.1 examples/topic_consumer.rb
stomp-1.3.0 examples/topic_consumer.rb
stomp-1.2.16 examples/topic_consumer.rb
stomp-1.2.14 examples/topic_consumer.rb
stomp-1.2.13 examples/topic_consumer.rb