Installing IBM WebSphere MQ Client on Linux

This is the second part in the IBM WebSphere MQ series. Installing IBM WebSphere MQ client is also very easy. It takes just a few minutes to install. IBM WebSphere MQ Client can be downloaded from http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg24019253.

Extract it to some folder (e.g /root/download/wmqc) after download. Then follow these steps.

1. cd /root/download/wmqc
2. ./mqlicense -accept

This is necessary since this instructs to accept the license, otherwise you will not be able install WebSphere MQ. If this gives a JRE error then give the JRE path like this:

2. ./mqlicense -accept -jre PATH_TO_JRE
3. rpm -ivh MQSeriesClient-x.x.x-x.i386.rpm MQSeriesRuntime-x.x.x-x.i386.rpm

where x.x.x-x is the version number like 7.0.1-1

That’s it! WMQ client has been installed. Now you can connect to WMQ server on another machine, or install WMQ SDK to start developing applications for IBM WebSphere MQ.

This is necessary since this instructs to accept the license, otherwise you will not be able install WebSphere MQ. If this gives a JRE error then give the JRE path like this:

2. ./mqlicense -accept -jre PATH_TO_JRE

Installing IBM WebSphere MQ Server on Linux

This is part 1 of the series on IBM WebSphere MQ. Installing IBM WebSphere MQ server on a Linux machine is easy. It takes just a few minutes to install. IBM WebSphere MQ can be downloaded from http://www.ibm.com/developerworks/downloads/ws/wmq/.

Extract it to some folder (e.g /root/download/wmq) after download. Then follow these steps.

1. cd /root/download/wmq
2. ./mqlicense -accept

This is necessary since this instructs to accept the license, otherwise you will not be able install WebSphere MQ. If this gives a JRE error then give the JRE path like this:

2. ./mqlicense -accept -jre PATH_TO_JRE
3. rpm -ivh MQSeriesServer-x.x.x-x.i386.rpm MQSeriesRuntime-x.x.x-x.i386.rpm

where x.x.x-x is the version number like 7.0.1-1

That’s it! WMQ server has been installed. The next steps include adding users in mqm group to grant access to users to perform certain operations like creating/deleting queue manager and queues, then creating queue manager then configuring it.

XMS.Net Consumer Application for IBM WebSphere MQ

Currently we are working on IBM WebSphere MQ to be used in our project. One feature that we need from several features of WebSphere MQ was to subscribe to a topic with selector string from a C#.Net application. IBM provides two libraries for .Net. One is MQI classes for .Net and another is XMS.Net (IBM Message Service Client for .Net). Finally we adopted XMS.Net, although we also tried MQI classes for .Net, but we moved to XMS.Net. Its totally a different story why we moved to XMS.Net. I might write another post on it πŸ™‚

So, at first place we tried to run sample consumer application came with XMS.Net library. Our center of the focus was selector string. When we were trying to run the sample consumer application and supplied the topic to subscribe to and selector string to filter the messages, it was getting stuck every time after subscription. Even it wasn’t receiving any messages, although we could see the subscription object being created on the WMQ server. One thing that we were doing was that we were running the sample in ‘client’ mode. When we switched the mode to ‘unmanaged’, everything ran smoothly. We were bit surprised! Why it wasn’t running in client mode? I think there is some bug, since I couldn’t find anything related in the docs. Might IBM will fix this issue in the future release.Β  But at last, somehow we managed to run the sample consumer application and finally we are at the stage where we can move forward.

So, if you are also trying to run XMS.Net application and want to subscribe to some topic with selector string to filter messages, remember to run the application in ‘unmanaged’ mode. You can find further information in XMS.Net doc (ftp://ftp.software.ibm.com/software/integration/support/supportpacs/individual/ia9h.pdf).

How to install MQSeries Perl Extension for IBM WebSphere MQ

I was having some issues installing MQSeries Perl Extension 1.29 for IBM WebSphere MQ (WMQ). What actually I did was downloaded the MQSeries module from the CPAN, extracted it and ran the perl Makefile.PL. But it gave me the following error:

> perl Makefile.PL
Checking if your kit is complete…
Looks good
ERROR from evaluation of /root/MQSeries-1.29/MQClient/Makefile.PL: No such directory ‘/opt/mqm’
Compilation failed in require at ./Makefile.PL line 14.
# Looks like your test died before it could output anything.

This seem as it needs /opt/mqm directory to install to and its not creating it by itself. But this was foolish assumption, as most applications create the required directories itself when installing, but still there wasn’t any clear error message. Then somehow I came to know about the client and I installed the MQSeriesClient. Installing MQSeriesClient requires MQSeriesRuntime as well. This created two directories:

  • /opt/mqm and
  • /var/mqm

So, that means Perl Extension was unable to find the client, but instead it was complaining about the directory. Well I moved forward and tried again installing MQSeries Perl Extension. But what? again error?

> perl Makefile.PL
Checking if your kit is complete…
Looks good
ERROR from evaluation of /home/jawaid/MQSeries-1.29/MQClient/Makefile.PL: Missing inc or include directory in /opt/mqm
Compilation failed in require at ./Makefile.PL line 14.
# Looks like your test died before it could output anything.

dahhh!! Now its complaining about another directory inc or include in /opt/mqm. That means it requires something else as well. The name of the directory i.e include, sparked in my mind that it might requires some kind of SDK or something. Then I checked the RPMs came with WMQ. I found MQSeriesSDK. hmmm so I thought lets try installing this RPM and try my luck again with installing Perl Extension. So I installed MQSeriesSDK and then MQSeries Perl Extension. woala!! this time it generated the make file without any errors πŸ™‚

> perl Makefile.PL
Checking if your kit is complete…
Looks good
Writing Makefile for MQClient::MQSeries
Writing Makefile for MQSeries::Message::DeadLetter
Writing Makefile for MQSeries::Message::PCF
Warning: Guessing NAME [MQSeries-OAM] from current directory name.
No libmqm server library found, MQServer disabled
Support for MQServer is disabled on this platform.
Warning: Guessing NAME [MQServer] from current directory name.
Writing Makefile for MQSeries

But hold your breath for more. You can expect anything now after happening all this. Anyway, I ran make successfully then ran make test… what?? it failed??Β  :'(

aaahhh!! now what?? never mind!! I just ran make install… guess what? no, you are wrong πŸ™‚ no errors this time, it got installed, even after failing the make test πŸ™‚

To verify i tried to run the example perl script in examples directory of MQSeries Perl Extension to put message in the queue, and i got an error from the MQSeries library that it didn’t find the queue, obviously there were no queues at the moment, that means Perl module is installed correctly…whew!!

That means installing the run time and client are not enough. You need to install the WMQ SDK as well to install the MQSeries Perl Extension.

Since I wanted to play with the WebSphere MQ, so when I failed to install the Perl Extension first time, I decided to install the server first on another machine. Somehow I managed to install the server. Then I tried to install the MQSeries Perl Extension, but to no avail. Even after installing the Client. Then I moved to another machine and did the whole this thing from scratch, and at last it worked πŸ™‚