examples/advanced/bytes_producer.rb in jruby-hornetq-0.4.0 vs examples/advanced/bytes_producer.rb in jruby-hornetq-0.5.0.alpha
- old
+ new
@@ -10,16 +10,16 @@
require 'hornetq'
HornetQ::Client::Connection.session('hornetq://localhost') do |session|
# Create the non-durable TestQueue to receive messages sent to the TestAddress
session.create_queue_ignore_exists('TestAddress', 'TestQueue', false)
-
+
# Create Producer so that we can send messages to the Address 'jms.queue.ExampleQueue'
session.producer('TestAddress') do |producer|
-
+
# Create a non-durable bytes message to send
message = session.create_message(HornetQ::Client::Message::BYTES_TYPE,false)
message.body = "#{Time.now}: ### Hello, World ###"
-
+
producer.send(message)
end
end