Using this beta & the samples

Getting started
To get started with the current IBM MQ Light beta, download the file for your platform from the homepage.


The following steps will guide you through the rest:

  1. After downloading the MQ Light beta file for your platform, extract the contents to a directory of your choice.
  2. From your chosen directory, double-click the 'mqlight-start.exe' on Microsoft® Windows®, or the 'Start IBM MQ Light' shortcut on Linux and Mac OS. This will launch IBM MQ Light on your local system, as shown in the screen capture.
  3. Upon first run, review the license agreement. If you wish to accept the license agreement, press '1'.
  4. Additionally upon the first running of MQ Light, choose whether or not to enable username and password security. See the MQ Light security page for more details.


When MQ Light starts, the new beta UI will also open in your browser:

MQ Light startup process

Software pre-reqs
  1. You will need a Node.js 0.10 runtime environment to use the MQ Light API module. This can be installed from http://nodejs.org/download/, or by using your operating system's package manager. The following are the currently supported platform architectures:
    • 64-bit or 32-bit runtime on Windows - Windows Installer (.msi)
    • 64-bit runtime on Linux - Linux Binaries (.tar.gz)
    • 64-bit runtime on Mac OS - Mac OS X Binaries (.tar.gz)
    You will currently receive an error if you attempt to use any other combination.

  2. To start working with the MQ Light Node.js API, install it to your working directory using npm:
    npm install mqlight@1.0

  3. Any Node.js source files that call the API need to include the following import statement:
    var mqlight = require("mqlight");

Before using MQ Light on Linux, you'll need to make sure you have the libuuid package installed. For example:
    • To check whether you have the package on Ubuntu, run: dpkg -l libuuid1
    • To check whether you have the package on RedHat, run: rpm -qa | grep libuuid

Sample Applications
A sample implementation for a pair of standalone Sender and Receiver applications is available in the following directory of your MQ Light node.js client install: <nodejs-client-path>/node_modules/mqlight/samples
The send.js and recv.js sample applications have the following usage:
 
    
    ################################################

    Usage: recv.js [options]

    Options:
      -h, --help            show this help message and exit
      -s URL, --service=URL service to connect to (default: amqp://localhost)
      -t TOPICPATTERN, --topic-pattern=TOPICPATTERN
                            subscribe to receive messages matching TOPICPATTERN
                            (default: public)
      -n NAME, --share-name NAME
                            optionally, subscribe to a shared destination using
                            NAME as the share name.

    ################################################

    Usage: send.js [options] <msg_1> ... <msg_n>

    Options:
      -h, --help            show this help message and exit
      -s URL, --service=URL service to connect to (default: amqp://localhost)
      -t TOPIC, --topic=TOPIC
                            send messages to topic TOPIC (default: public)
      -d NUM, --delay=NUM   add a NUM seconds time delay between each request

    ################################################

Sample Command Invocation
The above npm install command (npm install mqlight@1.0) will install the MQ Light node.js client to the current directory. If this directory is different to the one your intend on using, you will need to modify the NODE_PATH environment variable on both the receiver and sender, to the installation directory of your node_modules:
set NODE_PATH=C:\temp\node_modules

  1. Run the receiver: node recv.js
          
        C:\temp\node_modules\mqlight\samples>node recv.js
        Connected to localhost:5672 using client-id recv.js
        Subscribing to amqp://localhost:5672/public
        # received message (1)
        { address: 'amqp://localhost:5672/public', body: 'Hello World!' }
    

  2. Start the sender: node send.js
    
        C:\temp\node_modules\mqlight\samples>node send.js
        Connected to localhost:5672 using client-id send.js
        # sent message:
        { body: 'Hello World!', address: 'amqp://localhost:5672/public' }
    

  3. View the "Hello World!" message being sent & received in the MQ Light UI:

    The MQ Light UI displaying the


If you have enabled security for MQ Light, you will need to modify the samples to supply a username and password via the API. See the MQ Light security page for more details. For further info about using MQ Light when writing your own apps, see MQ Light concepts.

Removing MQ Light from your system
If you wish to remove MQ Light from your system, first ensure that it has been stopped. This can be done by navigating to the MQ Light install directory and running the 'mqlight-stop.exe' on Microsoft® Windows® or the 'Stop IBM MQ Light' shortcut on Linux and Mac OS. Having completed the stop command, MQ Light can be removed by deleting the MQ Light install directory.