Sha256: aefaa36c65d846b48f7e8c6a8cd6173e8e94e1d1ab57c0e4da0f551b12429e8b
Contents?: true
Size: 729 Bytes
Versions: 4
Compression:
Stored size: 729 Bytes
Contents
# simple_09.rb # Assumes that target message broker/server has a user called 'guest' with a password 'guest' # and that it is running on 'localhost'. # If this is not the case, please change the 'Bunny.new' call below to include # the relevant arguments e.g. b = Bunny.new(:user => 'john', :pass => 'doe', :host => 'foobar') $:.unshift File.dirname(__FILE__) + '/../lib' require 'bunny' b = Bunny.new(:logging => true, :spec => '09') # start a communication session with the amqp server b.start # declare a queue q = b.queue('test1') # publish a message to the queue q.publish('Hello everybody!') # get message from the queue msg = q.pop puts 'This is the message: ' + msg + "\n\n" # close the client connection b.stop
Version data entries
4 entries across 4 versions & 2 rubygems
Version | Path |
---|---|
celldee-bunny-0.5.2 | examples/simple_09.rb |
celldee-bunny-0.5.3 | examples/simple_09.rb |
bunny-0.5.3 | examples/simple_09.rb |
bunny-0.5.2 | examples/simple_09.rb |