Skip to content

Latest commit

 

History

History
191 lines (143 loc) · 4.92 KB

File metadata and controls

191 lines (143 loc) · 4.92 KB

IBM MQ containerized queue manager

Table of Contents

Purpose

Provide a repeatable, containerized IBM MQ queue manager for local development and integration testing so MQSC/PCF mapping assumptions can be verified against real command responses.

Files

  • scripts/dev/mq_start.sh — wrapper delegating to mq-rest-admin-dev-environment
  • scripts/dev/mq_stop.sh — wrapper delegating to mq-rest-admin-dev-environment
  • scripts/dev/mq_reset.sh — wrapper delegating to mq-rest-admin-dev-environment
  • scripts/dev/mq_seed.sh — wrapper delegating to mq-rest-admin-dev-environment
  • scripts/dev/mq_verify.sh — wrapper delegating to mq-rest-admin-dev-environment

Docker Compose, MQSC seed files, and web server configuration are owned by the mq-rest-admin-dev-environment repository.

Prerequisites

  • Docker Desktop or compatible Docker Engine.
  • IBM MQ container image access (license acceptance required).
  • The mq-rest-admin-dev-environment repository cloned as a sibling directory (../mq-rest-admin-dev-environment), or set MQ_DEV_ENV_PATH to its location.

Configuration

  • Image: MQ_IMAGE (defaults to icr.io/ibm-messaging/mq:latest).
  • Queue managers: QM1 and QM2 on a shared Docker network (mq-dev-net).
  • QM1 ports:
    • 1414: MQ listener.
    • 9443: mqweb console + REST API.
  • QM2 ports:
    • 1415: MQ listener.
    • 9444: mqweb console + REST API.
  • Embedded web server: MQ_ENABLE_EMBEDDED_WEB_SERVER=true in the compose file.
  • Credentials (REST + console):
    • mqadmin / mqadmin (admin)
    • mqreader / mqreader (read-only)
  • The compose file sets LICENSE=accept. You must accept the IBM MQ container license before running the image.

Quick start

  1. Start the queue manager:

    ./scripts/dev/mq_start.sh
  2. Seed deterministic objects:

    ./scripts/dev/mq_seed.sh
  3. Verify REST-based MQSC responses:

    ./scripts/dev/mq_verify.sh

Seed objects

The seed script defines a small, deterministic set of queues, channels, and related objects with a DEV. prefix. Re-run the seed at any time; all definitions use REPLACE to stay idempotent.

Verification workflow

The verification script posts runCommandJSON requests to the admin REST API and prints structured JSON responses for:

  • DISPLAY QLOCAL(DEV.QLOCAL)
  • DISPLAY CHANNEL(DEV.SVRCONN)

Payload shape (validated in this container):

{
  "type": "runCommandJSON",
  "command": "DISPLAY",
  "qualifier": "QLOCAL",
  "name": "DEV.QLOCAL"
}

Notes:

  • command must be the MQSC verb (for example, DISPLAY).
  • qualifier selects the object type (QMGR, QLOCAL, CHANNEL, etc.).
  • name is required for object-specific queries (not required for QMGR).

Queue manager example (no name required):

{
  "type": "runCommandJSON",
  "command": "DISPLAY",
  "qualifier": "QMGR"
}

Response shape (abbreviated):

{
  "commandResponse": [
    {
      "completionCode": 0,
      "reasonCode": 0,
      "parameters": {
        "queue": "DEV.QLOCAL",
        "defpsist": "YES",
        "descr": "dev local queue"
      }
    }
  ],
  "overallReasonCode": 0,
  "overallCompletionCode": 0
}

Defaults:

  • REST base URL: https://localhost:9443/ibmmq/rest/v2
  • Admin user: mqadmin
  • Admin password: mqadmin

Override these via environment variables if needed:

  • MQ_REST_BASE_URL
  • MQ_ADMIN_USER
  • MQ_ADMIN_PASSWORD

Integration test scaffolding

Integration tests live in tests/integration/test_mq_integration.py. The tests are skipped by default and require an explicit opt-in:

MQ_REST_ADMIN_RUN_INTEGRATION=1 uv run pytest -m integration

When enabled, the tests:

  • start the local MQ container (scripts/dev/mq_start.sh)
  • wait for the REST endpoint to become ready
  • seed deterministic objects (scripts/dev/mq_seed.sh)
  • run DISPLAY checks plus define/alter/delete lifecycles for DEV.TEST.* objects
  • stop the container after the session (scripts/dev/mq_stop.sh)

If you need a fully clean slate before the run, use ./scripts/dev/mq_reset.sh to remove the data volume.

Reset workflow

To return to a clean, known state (including removing the queue manager data volume):

./scripts/dev/mq_reset.sh

Troubleshooting

  • If the REST API is not reachable from the host, run:

    docker compose -f ../mq-rest-admin-dev-environment/config/docker-compose.yml exec -T qm1 \
      setmqweb properties -k httpHost -v "*"

    Then restart the container and retry the verification workflow.