$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
# This is your classic Hello World application, written in
# Ruby, that uses Qpid. It demonstrates how to send and
# also receive messages.
if __FILE__ == $0
broker = ARGV || "localhost:5672"
address = ARGV || "amq.topic"
options = ARGV || ""
connection = Qpid::Messaging::Connection.new :url => broker, :options => options
session = connection.create_session
receiver = session.create_receiver address
sender = session.create_sender address
# Send a simple message
sender.send Qpid::Messaging::Message.new :content => "Hello world!"
# Now receive the message
message = receiver.fetch Qpid::Messaging::Duration::SECOND
Download this file
Apache Qpid, Messaging built on AMQP; Copyright © 2013
The Apache Software Foundation; Licensed under
License, Version 2.0; Apache Qpid, Qpid, Qpid Proton,
Proton, Apache, the Apache feather logo, and the Apache Qpid
project logo are trademarks of The Apache Software
Foundation; All other marks mentioned may be trademarks or
registered trademarks of their respective owners