Sha256: ae8ff7b895489fe94b3111412ec7cb2b7525c0b75d8aa0ae390c19603e89d5c6

Contents?: true

Size: 825 Bytes

Versions: 15

Compression:

Stored size: 825 Bytes

Contents

# encoding: utf-8

# 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

15 entries across 15 versions & 2 rubygems

Version Path
bunny-0.7.13 examples/simple_ack_09.rb
bunny-0.7.12 examples/simple_ack_09.rb
bunny-0.7.11 examples/simple_ack_09.rb
bunny-0.7.10 examples/simple_ack_09.rb
sparqcode_bunny-0.0.2 examples/simple_ack_09.rb
bunny-0.7.9 examples/simple_ack_09.rb
sparqcode_bunny-0.0.1 examples/simple_ack_09.rb
bunny-0.7.8 examples/simple_ack_09.rb
bunny-0.7.6 examples/simple_ack_09.rb
bunny-0.7.5 examples/simple_ack_09.rb
bunny-0.7.4 examples/simple_ack_09.rb
bunny-0.7.3 examples/simple_ack_09.rb
bunny-0.7.2 examples/simple_ack_09.rb
bunny-0.7.1 examples/simple_ack_09.rb
bunny-0.7 examples/simple_ack_09.rb