Sha256: 7230113f8968a753a9bf05d16c3bdb428142204e4b0ff6861a543febe0341834

Contents?: true

Size: 682 Bytes

Versions: 1

Compression:

Stored size: 682 Bytes

Contents

#
# HornetQ Producer:
#          Write messages to the queue
#

# Allow examples to be run in-place without requiring a gem install
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'

require 'rubygems'
require 'hornetq'

HornetQ::Client::Factory.create_session(:connector=> {:uri => 'hornetq://localhost'}) do |session|
  # Create Producer so that we can send messages to the Address 'jms.queue.ExampleQueue'
  producer = session.create_producer('jms.queue.ExampleQueue')
  
  # Create a non-durable message to send
  message = session.create_message(HornetQ::Client::Message::TEXT_TYPE,false)
  message << "#{Time.now}: ### Hello, World ###"
  
  producer.send(message)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jruby-hornetq-0.2.1.alpha examples/client/producer.rb