In a previous blogpost, I described how you can install IBM MQ on your local development machine. This is still a lot of work just to get MQ up and running…
- IBM MQ multi-instance queue managers require shared storage. In this tutorial, you use GlusterFS, a distributed, scalable file system, as a shared file system between the nodes of each.
- Docker run -e LICENSE=accept -e MQQMGRNAME=MQ321 -e DB2INST1PASSWORD=pass -p -p 9459:9443 -p 5015:50000 allall4r And after all, I used command from: HERE So I executed.
This post describes how to run IBM MQ in Docker and get you up and running in less than 5 minutes!(you should have of course already a working installation of Docker Desktop on your machine)
Although using the MQ Explorer is not officially supported on a Mac, but it worked for us on MacOS Mojave 10.14.4, Eclipse 4.7.3a and MQ Explorer 9.1. Download Eclipse 4.7.3a for MacOS from the Eclipse SDK section on the eclipse archive or directly from eclipse-SDK-4.7.3a-macosx-cocoa-x8664.dmg.
The official GitHub repository of the MQ Container can be found here: https://github.com/ibm-messaging/mq-container.
Step 1 – Run MQ with default config
These instructions are based on the official usage documentation. In this example, I will not use the default MQ_DEV config.
Step 2 – Disable security
The default configuration has security configured out of the box. And that is a good thing! But it might be a bit annoying for local development.
Connect to your container using the cli. Use runmqsc to disable security and create a new channel that runs under the mqm user.
At this point, security is disabled and the channel “DEMO.ADMIN.SVRCONN” can be used for messaging (from Java / .NET) and admin purposes (MQ Explorer) without any security.
DISCLAIMER: you should only disable security like this in a development scenario!
Running free IBM® MQ for Developers (and Testers)
IBM have released a special IBM® MQ for Developers (and Testers) you can run for free. There are two main options how to run it.- Install on your laptop/server/VM
- Use the docker image
Running on Docker in AWS free tier from Windows
Unfortunately it is not possible to run Docker Linux images on Windows systems. So you cannot run a Docker IBM MQ for Developers on your Windows laptop. To work around that we will use a free AWS Linux virtual machine. We will sign up for a free AWS EC2 account, run a Linux VM there, install docker and run IBM MQ. AWS free tier will allow you to use a Linux host for a year free of charge. Follow these steps to install a Docker IBM® MQ for Developers on AWS free tier:Ibm Mq For Docker Macbook
- Create a free account on the AWS website. You will need a credit or debit card to register, but it will not be charged as long as you use the free tier only. Please note it might take up to 24 hours to activate your account.
- Create a linux virtual machine instance on AWS EC2. Make sure you keep the PEM file you have downloaded, you will use it to connect to the virtual machine very soon using PuTTY.
- Download PuTTY and PuTTYGen
- Connect using PuTTY to your AWS EC2 Linux instance
- You should now see a PuTTY connected to your instance
- Run the following commands to update yum and install docker, and make sure you do not get any errors:
- Display, read and make sure you understand and are OK with the IBM® MQ license by running: You will be accepting the license in the next step.
- Run Docker MQ (please notice that by setting LICENSE=accept you are accepting the license you have seen in the previous step):
- Allow for connections from your IP to the AWS EC2 instance on ports used by IBM® MQ (1414 and 9443) by adding new rules to the security group. Note that if your IP changes, you will loose the connectivity and have to do this step again.
- You can test the connection by using a web browser to connect to the web console. Open this URL in your browser https://your-ec2-hostname:9443/admin/ and use username admin and password passw0rd.
- Done! Your MQ instance is up and running. You can now try connecting to it with your application and Traffic Parrot by pointing them at your-ec2-hostname, port 1414, queue manager name QM1, username app and an empty password. There are a few default queues and topics defined there which you can use, if you need more you will have to add them. For more details see instruction at the official IBM® MQ docker image website.
- Next step, follow the JMS IBM® MQ mocking and service virtualization tutorial to learn how to simulate systems communication using IBM® MQ queues and topics and test your software in isolation. It will help you find more bugs and reduce time it takes to test.