Sha256: d75cf1779248376c8b6616d10b33c3ef351d1f942181711a747ee92ac29fb75b

Contents?: true

Size: 460 Bytes

Versions: 11

Compression:

Stored size: 460 Bytes

Contents

#
# Sample : get() : Retrieve a single message from a queue
#          If no messages are on the queue, message.data is nil
#
require 'rubygems'
require 'wmq'

WMQ::QueueManager.connect(:q_mgr_name=>'REID') do |qmgr|
  qmgr.open_queue(:q_name=>'TEST.QUEUE', :mode=>:input) do |queue|

    message = WMQ::Message.new
    if queue.get(:message => message)
      puts "Data Received: #{message.data}"
    else
      puts 'No message available'
    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
ferocia-rubywmq-2.0.7 examples/get_a.rb
ferocia-rubywmq-2.0.6 examples/get_a.rb
ferocia-rubywmq-2.0.4 examples/get_a.rb
ferocia-rubywmq-2.0.3 examples/get_a.rb
ferocia-rubywmq-2.0.2 examples/get_a.rb
ekaranto-rubywmq-2.0.2 examples/get_a.rb
rubywmq-2.0.2 examples/get_a.rb
rubywmq-2.0.1 examples/get_a.rb
ekaranto-rubywmq-2.0.0 examples/get_a.rb
rubywmq-2.0.0 examples/get_a.rb
rubywmq-2.0.0.pre3 examples/get_a.rb