Several examples have been put together to demonstrate how to use Ruby WMQ. They are also a good place to start when writing a new application. All of the examples below are included when the RubyWMQ gem is installed. To locate the examples: gem env gemdir cd 'path output above'/gems/rubywmq-1.0.0/examples Put one message to a Queue (Without opening the queue)- put1_a.rb
- put1_b.rb
- put1_c.rb
Put messages to a QueueRead one message from a queueReading Several messages from a Queue:- each_a.rb
- each_b.rb
- each_header.rb
Connect using MQ Client connectionPut Messages to a Queue as a group- put_group_a.rb
- put_group_b.rb
Put Messages to a Queue, including message headers- put_dlh.rb
- put_dynamic_q.rb
- put_rfh.rb
- put_rfh2_a.rb
- put_rfh2_b.rb
- put_xmit_q.rb
Writing multiple files to a queue, where each file is a separate message:- files_to_q.rb, files_to_q.cfg
Writing the contents of a queue to multiple files, where each message is a separate file:- q_to_files.rb, q_to_files.cfg
Sample “client” and “server” side applications for sending or processing requests |