Using the command line to configure IBM MQ

You can use the command line to create and configure IBM® MQ queues.

Before you begin

  1. Open a command window.
  2. Navigate to the directory where IBM MQ is installed, such as /opt/mqm/bin.

About this task

Follow these steps to configure IBM MQ from the command line.

Procedure

  1. Run this command to create a queue manager that is named MyQueueManager, where MyQueueManager is your designated queue manager name:
    crtmqm -c "Data Explorer Queue Manager" -ll -q 'MyQueueManager'
  2. Run this command to start the queue manager:
    strmqm MyQueueManager
  3. Run this command to open a IBM MQ Script:
    runmqsc MyQueueManager
  4. Run this command to define your local queue, where MyQueue is your designated queue name:
    define qlocal MyQueue
  5. Run these commands in sequence to disable the channel authentication:
    1. To display the channel authentication status, run:
      DISPLAY QMGR CHLAUTH   
      
    2. To disable channel authentication, run:
      ALTER QMGR CHLAUTH(DISABLED)
      
    3. To verify channel authentication, run:
      DISPLAY QMGR CHLAUTH
  6. Run this command to define the channel, where the MY_CHANNEL = the channel name, svrconn = the channel type, and tcp = the transport type.
    define channel(MY.CHANNEL) chltype(svrconn) trptype(tcp)
    
  7. Run this command to define the listener, where the MY_LISTENER = the listener name and is your designated 1416 is the listening port.
    DEFINE listener(MY_LISTENER) trptype(tcp) port(1416)
  8. Run this command to start the listener
    start listener(MY_LISTENER)
    

Results

Verify that the message started by MY_LISTENER is received.