9

I'm looking for a solution to run IBM MQ Client under a Windows Docker container. I know that Docker Hub only provides Linux implementations of MQ, however, I do not need full MQ Server capability. Instead, I'm hoping there's a means to install the MQ Client and simply connect to a Channel and Queues defined on another (non-Docker) system. To approach this, I've done the following:

  1. Spun up a Windows Docker container running under a command prompt (For proof of concept)

  2. Copied in and expanded MQ Client 9.0.0.8-IBM-MQC-Win64.zip

  3. Silently installed MQ Client (e.g. msiexec /i "c:\temp\Windows\MSI\IBM MQ.msi" /l*v c:\temp\install.log /q TRANSFORMS="1033.mst" AGREETOLICENSE="yes" ADDLOCAL="Client").

    Note: The installation was successful and without error

  4. Established required environment variables(MQServer, etc.) and updated paths (classpath, lib, include, etc).

  5. Pinged the MQ server system to verify connectivity.

I attempted to put a message on a working, verified queue using, amqsputc.exe MYDOCKER.DS.Q. The immediate return code is MQCONNX ended with reason code 2195. Unfortunately, 2195 is pretty generic and there are no other logs available to review.

I understand the differences between running MQ under a VM versus a container, however since I only need Client access, I was hoping MQ Client was lightweight enough to be usable.

If MQ Client is not a viable direction, is there an MQ solution which might be doable via a Cloud connection? My legacy application is Windows-based and relies on MQ for job messaging.

JoshMc
  • 10,239
  • 2
  • 19
  • 38
LumberJack
  • 111
  • 3
  • 1
    I would suggest you look at the MQ Redist client for this purpose, you need only unzip the file no install required. What language is your application written in? If it is .NET you could move to managed mode which requires only a single dll. If it is java you can get a jar file, etc, Please provide some more details to help find a solution. – JoshMc Feb 11 '20 at 22:14
  • There should be an AMQERR01.LOG and possibly an FDC file to detail further what the problem reported in the 2195 (MQRC_UNEXPECTED_ERROR) was. – Morag Hughson Feb 12 '20 at 04:29
  • Thanks for your thoughts. The .zip file noted in step 2 is the MQ Redist client, so I think I'm on the right track with it. My program is an older application written using C/C++ and under direct Windows or even a VM, the MQ client interface works fine. Setting the actual application aside, I am simply attempting to verify an IBM MQ Client installation under a container by using the IBM "amqsputc.exe" and "amqsgetc.exe" utilities to post a message and then subsequently pop a message off of the Queue Manager. Sadly, there is no AMQERR*.log created anywhere within my container instance – LumberJack Feb 12 '20 at 15:00
  • The zip file noted is not the redist client unless you renamed it. Redist zip has `Redist` in the fire name and would not require a MSI install, you just unzip it, no install required. Google "MQC9" for fix central download links. – JoshMc Feb 12 '20 at 17:44
  • Please try that first. AMQERR01.LOG with the real Redist client will get created under the user's `homedrive\homedir\IBM\MQ\data\errors` directory. – JoshMc Feb 12 '20 at 17:47
  • 9.0.0.8-IBM-MQC-Win64.zip is just the client on Windows 64-bit from Fix Central - it is not the redistributable client as @JoshMc says. You say that you have set up the relevant environment variables and paths. Could you tell us what your MQ_DATA_PATH is? You didn't provide DATFOLDER on the install, so I'm not sure what you end up with as the data path if you don't set one. The errors directory will be in your data path, and there should be an AMQERR01.LOG in there. – Morag Hughson Feb 12 '20 at 20:25
  • Per IBM, the default data path is the install folder, so it was not explicitly set. For the client I installed, there was no error log created anywhere when running my test. I will create a "clean" container instance and download the Redist image and work with it. My apologies for not recognizing the difference between the two. Note: I will be off project for a few days and may not be able to report results until early next week. I am very grateful for your input and suggestions. Thanks! – LumberJack Feb 13 '20 at 16:08
  • @JoshMc @ Morag Hughson - Unpacked Redist image into c:\temp. Tried running, "c:\temp\bin\setmqenv.cmd -m CSQ3 -p c:\temp -s". Got an "AMQ7047" error. Checked the logs and saw: "02/19/20 13:53:16 - Process(8020.1) Program(crtmqenv.exe) Host(83EB90FAD73F) Installation(MQNI09000004) VRMF(9.0.0.4) - AMQ6119: An internal IBM MQ error has occurred (User name too long : (Arith1) >(Arith2))" No hits on this at IBM support site. I am not sending either a Username or Password, as these are not required by the setmqenv.cmd command. I'm trying to use an IBM supplied utility to confirm the env. – LumberJack Feb 19 '20 at 14:23
  • I noticed there is an APAR out there but if username is longer than 12 characters MQ internally used "UNKNOWN" and causes those errors. Also since the QM is not local it doesn't really make any sense to specify `-m CSQ3` as a option to the `setmqenv.cmd`. I'm sure `setmqenv.cmd` is common between client and server installs, on a server install this would tell it to set the env to the one for the install used by that queue manager. I think you are ok to use just `-p`. – JoshMc Feb 19 '20 at 15:19
  • Looks like the limit is 20 characters per this link: [Why am I getting a MQRC_ENVIRONMENT_ERROR](https://developer.ibm.com/answers/questions/335192/why-am-i-getting-a-mqrc-environment-error-2012-aft/). Can you confirm that the user you are running `setmqenv.cmd` as is longer than 20 characters? – JoshMc Feb 19 '20 at 17:07
  • 1
    Did you ever get this working? – JoshMc Jun 14 '20 at 23:26
  • @DaBozUK I was attempting to help the OP out but never received answers to some of my questions, can you please answer the same? – JoshMc Nov 16 '20 at 19:11
  • For example, if you are using the IBM MQ classes for Java or the IBM MQ classes for JMS, you simply download the Java-All client or build you app by referencing this via Maven. If you are using the IBM .NET or XMS.NET libraries in managed mode or the new .NET standard libraries, you can add the required dll (this is available on Nuget). If you are using a compiled program that uses the C API shared library files then the Redist client can be used, you simply unzip it and make sure the proper lib directory is in your PATH. – JoshMc Nov 16 '20 at 19:20
  • Without more specifics on what problem you are having it is hard to provide a solution. 2195 is the most generic of errors that is thrown when no specific error has been caught, this means it can have many different causes, the reason the OP was getting appears to be due to the length of the username that was running the command, in your case it may be a different cause. – JoshMc Nov 16 '20 at 19:24
  • @JoshMc I am using C++ (AMQI) libs. What definitely works is installing Windows Server 2016 or 2019 (GUI version) and the MQ Client 8.0.0.8 x64 installer (msiexec or GUI) and then our C++ application attempts a connection and will error with 2058 or similar (can't find QM). But if I use ANY Windows Server docker image, the msiexec does not appear to correctly install as PATH is not updated, and when our application attempts connection we get 2195 unknown error. I've since found that using MQC *redist* zip with 6 VC++ redist packages works. So i'm assuming the 2195 is a DLL dependency issue. – DaBozUK Nov 17 '20 at 10:30
  • Any reason not to go with redist if it works? – JoshMc Nov 17 '20 at 12:02
  • No it's what I will go with in the absence of the msiexec working. Seems that the Windows container needs VC 2012 x64 redist (as well as other redists our software needs). I did try this pre-req with msiexec MQC and that didn't work. So I guess the takeaway is that MQC installer flat out doesn't work with Windows containers, and that MQC redist + VC redist is the way forward. When I get time I'll formulate into a more readable answer and submit below. – DaBozUK Nov 17 '20 at 14:22
  • Does the 2195 generate a FDC file. It would be more helpful to understand why that fails if you can provide the top portion summary of the FDC. – JoshMc Nov 17 '20 at 15:17
  • is it working from the docker host itself ? @LumberJack – alex Nov 19 '20 at 10:18
  • @DaBozUK Does the 2195 generate a FDC file. It would be more helpful to understand why that fails if you can provide the top portion summary of the FDC. – JoshMc Nov 22 '20 at 00:26
  • 1
    @DaBozUK I posted a answer with links to the Redist client at mentioned in my comments above along with the requirement for the Microsoft C/C++ runtime libraries. – JoshMc Nov 23 '20 at 12:28

2 Answers2

3

Instead of installing the Full client install using msiexec, I would recommend that you use the IBM MQ Redistributable client install. This is packaged as a simple zip file for windows which you can extract into any location you choose.


You can find more information about the Redistributable client on the Knowledge Center page Redistributable IBM MQ clients.

You can download the IBM MQ Redistributable clients using the links below:


The IBM Knowledge center page Limitations and other considerations for redistributable clients gives these requirements:

Windows C runtime libraries
You might have these libraries on your machine already, but if you do not, you need to download and install the following Microsoft C/C++ runtime libraries:

  • Microsoft Visual C++ Redistributable 2008
  • Microsoft Visual C++ Redistributable 2012

The download links for the redistributable downloads for each of these libraries can be found at The latest supported Visual C++ downloads.

JoshMc
  • 10,239
  • 2
  • 19
  • 38
  • Thanks Josh, much appreciate the thought process we went through here. Installing the MQ redist is very easy. Unzip to a folder, add that folder to the system path, install the VC redists (in my case I needed vcredist 2012 x64) – DaBozUK Nov 24 '20 at 16:17
  • Thank you for awarding the bounty, I appreciate it. – JoshMc Nov 24 '20 at 16:29
1

A possible alternative (and lighter) approach: Write a Go app using the IBM mq-golang package and deploy that in your Windows docker container.