examples/advanced/producer.rb in jruby-hornetq-0.3.2 vs examples/advanced/producer.rb in jruby-hornetq-0.3.3

- old
+ new

@@ -16,16 +16,17 @@ config = YAML.load_file(File.dirname(__FILE__) + '/hornetq.yml')['development'] # Create a HornetQ session HornetQ::Client::Connection.session(config) do |session| # Create a non-durable TestQueue to receive messages sent to the TestAddress - session.create_queue_ignore_exists('jms.queue.SampleQueue', 'jms.queue.SampleQueue', false) + session.create_queue_ignore_exists('TestAddress', 'TestQueue', false) start_time = Time.now - session.producer('jms.queue.SampleQueue') do |producer| + session.producer('TestAddress') do |producer| puts "Sending messages" (1..count).each do |i| message = session.create_message(HornetQ::Client::Message::TEXT_TYPE,false) + message.body = "#{Time.now}: ### Hello, World ###" message.body = "#{Time.now}: #{i} : ### Hello, World ###" message.user_id = Java::org.hornetq.utils::UUIDGenerator.getInstance.generateUUID producer.send(message) puts "#{i}\n" if i%1000 == 0