examples/client/advanced/server.rb in jruby-hornetq-0.2.1.alpha vs examples/client/advanced/server.rb in jruby-hornetq-0.2.3.alpha
- old
+ new
@@ -13,11 +13,11 @@
timeout = (ARGV[0] || 60000).to_i
config = YAML.load_file(File.dirname(__FILE__) + '/hornetq.yml')['development']
# Create a HornetQ session
-HornetQ::Client::Factory.create_session(config) do |session|
+HornetQ::Client::Factory.session(config) do |session|
server = session.create_server('jms.queue.ExampleQueue', timeout)
session.start
count = 0
start_time = Time.now
@@ -26,10 +26,10 @@
count += 1
print '.'
puts "#{count}" if count%1000 == 0
puts "Durable" if request_message.durable
reply_message = session.create_message(HornetQ::Client::Message::TEXT_TYPE, false)
- reply_message << "Test Response"
+ reply_message.body = "Test Response"
reply_message
end
duration = Time.now - start_time - timeout/1000
puts "\nReceived #{count} requests in #{duration} seconds at #{count/duration} messages per second"