examples/client/advanced/batch_client.rb in jruby-hornetq-0.2.1.alpha vs examples/client/advanced/batch_client.rb in jruby-hornetq-0.2.3.alpha
- old
+ new
@@ -62,11 +62,11 @@
#print "Sending #{total_count} messages"
start_time = Time.now
total_count.times do |i|
message = @session.create_message(HornetQ::Client::Message::TEXT_TYPE,false)
message.reply_to_queue_name = @consumer.queue_name
- message << "Request Current Time. #{i}"
+ message.body = "Request Current Time. #{i}"
@producer.send(message)
print "."
#puts "Sent:#{message}"
end
duration = Time.now - start_time
@@ -94,10 +94,10 @@
@session.delete_queue(@consumer.queue_name)
end
end
# Create a HornetQ session
-HornetQ::Client::Factory.create_session(config) do |session|
+HornetQ::Client::Factory.session(config) do |session|
batching_size = total_count if batching_size > total_count
client = BatchClient.new(session, request_address)
# Start receive thread