14 August 2009

RubyWMQ

I've been playing with ruby (and rails) for about a day now, and I'm starting to really like it. It's even beginning to collide with work, found a really useful interface into MQ - which is the product I work on, RubyWMQ. It's incredibly easy to use - the following, for example, connects to a queue manager and puts a 'Hello world' message:

require 'rubygems'
require 'wmq/wmq'

WMQ::QueueManager.connect(:q_mgr_name=>'RUBYQM') do |qmgr|
qmgr.put(:q_name=>'QL', :data => 'Hello World')
result = 'CC ' + qmgr.comp_code.to_s + ' RC ' + qmgr.reason_code.to_s
puts result
end

It even prints out the compcode and reason aswell!

1 comment:

Victor said...

Hi,

I'm evaluating using RubyWMQ in my workplace too.

Is RubyWMQ working well on your end?

Thanks,
Victor