Sha256: 0e8e8c94cb2f3765907e3fa6a9f4689fcb2e119eb5e32bb60ac941d2e0dfc59a

Contents?: true

Size: 777 Bytes

Versions: 20

Compression:

Stored size: 777 Bytes

Contents

# simple_ack.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)

# 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)

# acknowledge receipt of message
q.ack

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

# close the client connection
b.stop

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
celldee-bunny-0.1.1 examples/simple_ack.rb
celldee-bunny-0.2.0 examples/simple_ack.rb
celldee-bunny-0.3.1 examples/simple_ack.rb
celldee-bunny-0.4.0 examples/simple_ack.rb
celldee-bunny-0.4.1 examples/simple_ack.rb
celldee-bunny-0.4.2 examples/simple_ack.rb
celldee-bunny-0.4.3 examples/simple_ack.rb
celldee-bunny-0.4.4 examples/simple_ack.rb
celldee-bunny-0.5.0 examples/simple_ack_08.rb
celldee-bunny-0.5.1 examples/simple_ack_08.rb
fotonauts-bunny-0.4.0 examples/simple_ack.rb
bunny-0.5.1 examples/simple_ack_08.rb
bunny-0.4.4 examples/simple_ack.rb
bunny-0.1.1 examples/simple_ack.rb
bunny-0.2.0 examples/simple_ack.rb
bunny-0.4.1 examples/simple_ack.rb
bunny-0.3.1 examples/simple_ack.rb
bunny-0.4.3 examples/simple_ack.rb
bunny-0.4.2 examples/simple_ack.rb
bunny-0.4.0 examples/simple_ack.rb