Sha256: 744afe3759c60f47f02e8a3e9c8a3ed576e4f9a25118408f2b54539587e75312
Contents?: true
Size: 735 Bytes
Versions: 34
Compression:
Stored size: 735 Bytes
Contents
# -*- encoding: utf-8 -*- require 'rubygems' require 'stomp' # # == Example message consumer. # class ExampleConsumer # 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 ronaldo" client.subscribe("/queue/ronaldo", {:ack => "client", "activemq.prefetchSize" => 1, "activemq.exclusive" => true }) do |msg| File.open("file", "a") do |f| f.write(msg.body) f.write("\n----------------\n") end client.acknowledge(msg) end loop do sleep(1) puts "." end end end # e = ExampleConsumer.new e.run
Version data entries
34 entries across 32 versions & 2 rubygems