Parent

Methods

Class/Module Index [+]

Quicksearch

ExamplePublisher

Example message publisher

Public Class Methods

new() click to toggle source

Initialize.

# File examples/publisher.rb, line 9
def initialize
end

Public Instance Methods

run() click to toggle source

Run example.

# File examples/publisher.rb, line 12
def run
  client = Stomp::Client.new("failover://(stomp://:@localhost:61613,stomp://:@remotehost:61613)?initialReconnectDelay=5000&randomize=false&useExponentialBackOff=false")
  message = "ronaldo #{ARGV[0]}"

  for i in (1..50)
    puts "Sending message"
    client.publish("/queue/ronaldo", "#{i}: #{message}", {:persistent => true})
    puts "(#{Time.now})Message sent: #{i}"
    sleep 0.2
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.