examples/each_a.rb in ferocia-rubywmq-2.0.7 vs examples/each_a.rb in ferocia-rubywmq-2.1.1
- old
+ new
@@ -1,14 +1,13 @@
#
# Sample : each() : Retrieve all messages from a queue
# If no messages are on the queue, the program
# completes without waiting
#
-require 'rubygems'
require 'wmq'
-WMQ::QueueManager.connect(:q_mgr_name=>'REID') do |qmgr|
- qmgr.open_queue(:q_name=>'TEST.QUEUE', :mode=>:input) do |queue|
+WMQ::QueueManager.connect(q_mgr_name: 'REID') do |qmgr|
+ qmgr.open_queue(q_name: 'TEST.QUEUE', mode: :input) do |queue|
queue.each do |message|
puts "Data Received: #{message.data}"
end
end
puts 'Completed.'