Sha256: 4ed3803a8295eb947e9605f4dc0caf0b4fb2b9578370dcba8c2a177ce851ec43

Contents?: true

Size: 805 Bytes

Versions: 10

Compression:

Stored size: 805 Bytes

Contents

# simple_ack_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('Testing acknowledgements')

# get message from the queue
msg = q.pop(:ack => true)[:payload]

# acknowledge receipt of message
q.ack

puts 'This is the message: ' + msg + "\n\n"

# close the client connection
b.stop

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
sidekick-client-0.2.5 lib/ext/bunny-0.6.0/examples/simple_ack_09.rb
bunny-0.6.3.rc2 examples/simple_ack_09.rb
bunny-0.6.3.rc1 examples/simple_ack_09.rb
sidekick-client-0.2.4 lib/ext/bunny-0.6.0/examples/simple_ack_09.rb
sidekick-client-0.2.3 lib/ext/bunny-0.6.0/examples/simple_ack_09.rb
sidekick-client-0.2.2 lib/ext/bunny-0.6.0/examples/simple_ack_09.rb
sidekick-client-0.2.1 lib/ext/bunny-0.6.0/examples/simple_ack_09.rb
sidekick-client-0.2.0 lib/ext/bunny-0.6.0/examples/simple_ack_09.rb
sidekick-client-0.1.0 lib/ext/bunny-0.6.0/examples/simple_ack_09.rb
bunny-0.6.0 examples/simple_ack_09.rb