summaryrefslogtreecommitdiff
path: root/deps/rabbitmq_stomp/examples/ruby/exchange-sender.rb
diff options
context:
space:
mode:
Diffstat (limited to 'deps/rabbitmq_stomp/examples/ruby/exchange-sender.rb')
-rw-r--r--deps/rabbitmq_stomp/examples/ruby/exchange-sender.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/deps/rabbitmq_stomp/examples/ruby/exchange-sender.rb b/deps/rabbitmq_stomp/examples/ruby/exchange-sender.rb
new file mode 100644
index 0000000000..ed556eacae
--- /dev/null
+++ b/deps/rabbitmq_stomp/examples/ruby/exchange-sender.rb
@@ -0,0 +1,12 @@
+require 'rubygems'
+require 'stomp'
+
+client = Stomp::Client.new("guest", "guest", "localhost", 61613)
+
+# This publishes a message to the 'amq.fanout' exchange which is managed by
+# AMQP broker and specifies routing-key of 'test'. You can get other exchanges
+# through 'list_exchanges' subcommand of 'rabbitmqctl' utility.
+client.publish("/exchange/amq.fanout/test", "test message")
+
+# close this connection
+client.close