Sha256: 255d38fb693d4355d8cd1ffb13fa3fb169e57ddbea93b5879dc86a10db72aad7

Contents?: true

Size: 834 Bytes

Versions: 5

Compression:

Stored size: 834 Bytes

Contents

#
# HornetQ Producer:
#          Write binary/bytes 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::Connection.session('hornetq://localhost') do |session|
  # Create the non-durable TestQueue to receive messages sent to the TestAddress
  session.create_queue_ignore_exists('TestAddress', 'TestQueue', false)
  
  # Create Producer so that we can send messages to the Address 'jms.queue.ExampleQueue'
  session.producer('TestAddress') do |producer|
  
    # Create a non-durable bytes message to send
    message = session.create_message(HornetQ::Client::Message::BYTES_TYPE,false)
    message.body = "#{Time.now}: ### Hello, World ###"
  
    producer.send(message)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jruby-hornetq-0.4.0 examples/advanced/bytes_producer.rb
jruby-hornetq-0.3.3 examples/advanced/bytes_producer.rb
jruby-hornetq-0.3.2 examples/advanced/bytes_producer.rb
jruby-hornetq-0.3.1 examples/advanced/bytes_producer.rb
jruby-hornetq-0.3.0.alpha examples/advanced/bytes_producer.rb