Ruby WMQ.

Ruby interface into WebSphere MQ (MQSeries) ®

Frequently Asked Questions

1. Programs fail with: `require': no such file to load -- wmq/wmq (LoadError)

After successfully installing RubyWMQ using the command “gem install rubywmq”, all the scripts are failing with output similar to the following:

   rubywmq-0.3.0/tests/test.rb:4:in `require': no such file to load -- wmq/wmq (LoadError)

        from rubywmq-0.3.0/tests/test.rb:4

Answer:  Ruby currently requires an additional step to include any gems installed using RubyGems. After installing RubyWMQ using Ruby Gems it is recommended on UNIX/Linux  systems to add the following line to the user profile (e.g. .profile):
export RUBYOPT=rubygems

For further information, see Ruby Gems installation manual:

http://rubygems.org/read/chapter/3#page70

 

2. Program fails to connect with MQRC2059, MQRC_Q_MGR_NOT_AVAILABLE

When connecting to either a local or remote WebSphere MQ Queue Manager, a very common error returned is that the Queue Manager is not available. This error can occur under any of the following circumstances:

MQ Server Connections (Local Queue Manager)

· Configuration Issues:

· Ensure that :connection_name is not being supplied to the connect method. Even if it is supplied with a nul or empty value, it will cause a client connection attempt to be made.

· Is the Queue Manager active?

· Try running the following command on the machine running the Queue Manager and check that the Queue Manager is marked as ‘Running’:

dspmq

Expected output:

QMNAME(REID)                          STATUS(Running)

Check that the :q_mgr_name supplied to QueueManager::connect matches the Queue Manager name above. Note: Queue Manager names are case-sensitive

MQ Client Connections (Remote Queue Manager)

· Client Configuration Issues:

· Incorrect host name

· Incorrect port number

· Incorrect Channel Name

· E.g. The channel being used does not exist on the remote Queue Manager.

· Note: The channel name is case-sensitive

· Incorrect Queue Manager Name

· :q_mgr_name is optional for Client Connections. It does however ensure that the program connects to the expected Queue Manager.
E..g If the wrong Queue Manager listener is now running on your expected port.

· Is the MQ listener program running on the port supplied above?

· On UNIX/Linux, try the following command on the machine running the Queue Manager:

ps -ef | grep runmqlsr

The Queue Mananger name and port number should be displayed

If no port number is specified on the command line for an instance of runmqlsr, it means that it is using port 1414.

· Is the Queue Manager active?

· Try running the following command on the machine running the Queue Manager and check that the Queue Manager is marked as ‘Running’:

dspmq

Expected output:

QMNAME(REID)                          STATUS(Running)

Check that the :q_mgr_name supplied to QueueManager::connect matches the Queue Manager name above. Note: Queue Manager names are case-sensitive

· Check if the Channel being used is still defined on the Queue Manager

· On the machine running the Queue Manager, run the following commands (may need to run them under the 'mqm' userid):

runmqsc queue_manager_name

dis channel(*) chltype(SVRCONN)

Replace queue_manager_name above with the actual name of the Queue Manager being connected to

Look for the channel name the application is using. Note: the channel name is case-sensitive.