Sha256: 93b89435a4e3f5e559d2127843c23d0f0b959e2eb6278a041958efad58b6ac67

Contents?: true

Size: 847 Bytes

Versions: 15

Compression:

Stored size: 847 Bytes

Contents

# encoding: utf-8

# simple_publisher_08.rb

# N.B. To be used in conjunction with simple_consumer_08.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

15 entries across 15 versions & 2 rubygems

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