Sha256: bbad28b2452cf08a6d3c52d70eac88f133654381dc9f0ae89486ce6144b9649e

Contents?: true

Size: 821 Bytes

Versions: 18

Compression:

Stored size: 821 Bytes

Contents

# simple_publisher.rb

# N.B. To be used in conjunction with simple_consumer.rb. See simple_consumer.rb for explanation.

# 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

# create/get exchange
exch = b.exchange('sorting_room')

# publish message to exchange
exch.publish('This is a message from the publisher', :key => 'fred')

# message should now be picked up by the consumer so we can stop
b.stop

Version data entries

18 entries across 18 versions & 3 rubygems

Version Path
celldee-bunny-0.2.0 examples/simple_publisher.rb
celldee-bunny-0.3.1 examples/simple_publisher.rb
celldee-bunny-0.4.0 examples/simple_publisher.rb
celldee-bunny-0.4.1 examples/simple_publisher.rb
celldee-bunny-0.4.2 examples/simple_publisher.rb
celldee-bunny-0.4.3 examples/simple_publisher.rb
celldee-bunny-0.4.4 examples/simple_publisher.rb
celldee-bunny-0.5.0 examples/simple_publisher_08.rb
celldee-bunny-0.5.1 examples/simple_publisher_08.rb
fotonauts-bunny-0.4.0 examples/simple_publisher.rb
bunny-0.5.1 examples/simple_publisher_08.rb
bunny-0.4.4 examples/simple_publisher.rb
bunny-0.4.0 examples/simple_publisher.rb
bunny-0.2.0 examples/simple_publisher.rb
bunny-0.4.1 examples/simple_publisher.rb
bunny-0.3.1 examples/simple_publisher.rb
bunny-0.4.3 examples/simple_publisher.rb
bunny-0.4.2 examples/simple_publisher.rb