Sha256: 40a419944da223542eb34e05ed3e8f7536d6c8843372f4b684cd4a96843c0959
Contents?: true
Size: 905 Bytes
Versions: 3
Compression:
Stored size: 905 Bytes
Contents
# # HornetQ Consumer: # Reply to a request # # Allow examples to be run in-place without requiring a gem install $LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib' require 'rubygems' require 'hornetq' timeout = (ARGV[0] || 60000).to_i HornetQ::Client::Factory.start(:connector=> {:uri => 'hornetq://localhost'}) do |session| server = session.create_server('jms.queue.ExampleQueue', timeout) puts "Waiting for Requests..." server.run do |request_message| puts "Received:[#{request_message.body}]" # Create Reply Message reply_message = session.create_message(HornetQ::Client::Message::TEXT_TYPE, false) reply_message.body = "Echo [#{request_message.body}]" # The result of the block is the message to be sent back reply_message end # Server will stop after timeout period after no messages received. Set to 0 to wait foreve server.close end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
jruby-hornetq-0.2.5.alpha | examples/client/server.rb |
jruby-hornetq-0.2.3.alpha | examples/client/server.rb |
jruby-hornetq-0.2.1.alpha | examples/client/server.rb |