# ibm-messaging/mq-container architecture

> Architecture diagram of the GitHub repository ibm-messaging/mq-container, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ibm-messaging/mq-container
- Repository: https://github.com/ibm-messaging/mq-container

## Overview

This repository runs IBM MQ in a container. The main workflow initializes and starts a queue manager, then container probes report its health, readiness, and startup state. A developer entry point adds developer configuration before handing off to the main server. Separate capabilities include Kubernetes metadata and ready-replica support, authentication and TLS, HA, metrics, tracing, and log handling. The graph follows documented behavior and visible imports/calls; several capabilities are represented at their source directory because their implementation was not sampled.

Main entry points: [`cmd/runmqserver/main.go`](https://github.com/ibm-messaging/mq-container/blob/master/cmd/runmqserver/main.go) (MQ server startup), [`cmd/runmetadataserver/server.go`](https://github.com/ibm-messaging/mq-container/blob/master/cmd/runmetadataserver/server.go) (Metadata sidecar), [`cmd/runmqdevserver/main.go`](https://github.com/ibm-messaging/mq-container/blob/master/cmd/runmqdevserver/main.go) (Developer setup), [`internal/simpleauth/simpleauth.go`](https://github.com/ibm-messaging/mq-container/blob/master/internal/simpleauth/simpleauth.go) (Developer simple auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["MQ runtime"]
  node_mqserver["MQ server startup<br/>[main.go]"]
  node_qmgr["Queue manager lifecycle"]
  node_devserver["Developer setup<br/>[main.go]"]
  node_mqhealth["MQ health probe<br/>[main.go]"]
  node_mqready["MQ readiness probe<br/>[main.go]"]
  node_mqstarted["MQ startup probe<br/>[main.go]"]
end

subgraph group_cluster["Cluster coordination"]
  node_metadata["Metadata sidecar<br/>[server.go]"]
  node_kubeclient["Kubernetes API client<br/>[client.go]"]
  node_metachecks["Metadata probes<br/>[main.go]"]
  node_metaready["Metadata readiness check<br/>[main.go]"]
  node_ha["High availability"]
end

subgraph group_security["Security and configuration"]
  node_tls["TLS configuration<br/>[tls.go]"]
  node_keystore["Key stores<br/>[keystore.go]"]
  node_securityutil["Security utilities<br/>[securityutility.go]"]
end

subgraph group_observability["Observability"]
  node_metrics["Prometheus metrics"]
  node_probes["Probe logging<br/>[probesocket.go]"]
  node_logrotation["Log rotation<br/>[logrotation.go]"]
end

subgraph group_auth["Authentication"]
  node_authsimple["Developer simple auth<br/>[simpleauth.go]"]
  node_c_auth["MQ simple-auth exit<br/>[mqsimpleauth.c]"]
end

node_operator(("Container operator"))

node_operator -->|"runs container"| node_mqserver
node_operator -->|"selects developer image"| node_devserver
node_devserver -->|"execs"| node_mqserver
node_mqserver -.->|"starts"| node_qmgr
node_mqserver -->|"configures"| node_ha
node_mqserver -->|"configures"| node_metrics
node_mqserver -->|"configures"| node_tls
node_mqserver -->|"configures"| node_authsimple
node_mqserver -->|"starts logging"| node_probes
node_devserver -->|"checks credentials"| node_authsimple
node_mqhealth -->|"logs probe"| node_probes
node_mqready -->|"sends status"| node_metadata
node_mqstarted -->|"checks status"| node_metadata
node_mqstarted -->|"uses probe logging"| node_probes
node_metadata -->|"uses client"| node_kubeclient
node_metadata -->|"serves health and status"| node_operator
node_metachecks -->|"checks liveness"| node_metadata
node_metaready -->|"checks readiness"| node_metadata
node_tls -->|"creates stores"| node_keystore
node_authsimple -->|"uses utilities"| node_securityutil
node_c_auth -.->|"provides auth exit"| node_mqserver
node_mqserver -.->|"configures logging"| node_logrotation

click node_mqserver "https://github.com/ibm-messaging/mq-container/blob/master/cmd/runmqserver/main.go"
click node_qmgr "https://github.com/ibm-messaging/mq-container/tree/master/cmd/runmqserver"
click node_devserver "https://github.com/ibm-messaging/mq-container/blob/master/cmd/runmqdevserver/main.go"
click node_mqhealth "https://github.com/ibm-messaging/mq-container/blob/master/cmd/chkmqhealthy/main.go"
click node_mqready "https://github.com/ibm-messaging/mq-container/blob/master/cmd/chkmqready/main.go"
click node_mqstarted "https://github.com/ibm-messaging/mq-container/blob/master/cmd/chkmqstarted/main.go"
click node_metadata "https://github.com/ibm-messaging/mq-container/blob/master/cmd/runmetadataserver/server.go"
click node_kubeclient "https://github.com/ibm-messaging/mq-container/blob/master/cmd/runmetadataserver/kubeapi/client.go"
click node_metachecks "https://github.com/ibm-messaging/mq-container/blob/master/cmd/chkmetadatahealthy/main.go"
click node_metaready "https://github.com/ibm-messaging/mq-container/blob/master/cmd/chkmetadataready/main.go"
click node_ha "https://github.com/ibm-messaging/mq-container/tree/master/internal/ha"
click node_tls "https://github.com/ibm-messaging/mq-container/blob/master/internal/tls/tls.go"
click node_keystore "https://github.com/ibm-messaging/mq-container/blob/master/internal/keystore/keystore.go"
click node_securityutil "https://github.com/ibm-messaging/mq-container/blob/master/internal/securityutility/securityutility.go"
click node_metrics "https://github.com/ibm-messaging/mq-container/tree/master/internal/metrics"
click node_probes "https://github.com/ibm-messaging/mq-container/blob/master/internal/probes/probesocket.go"
click node_logrotation "https://github.com/ibm-messaging/mq-container/blob/master/pkg/logrotation/logrotation.go"
click node_authsimple "https://github.com/ibm-messaging/mq-container/blob/master/internal/simpleauth/simpleauth.go"
click node_c_auth "https://github.com/ibm-messaging/mq-container/blob/master/authservice/mqsimpleauth/src/mqsimpleauth.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mqserver,node_qmgr,node_devserver,node_mqhealth,node_mqready,node_mqstarted toneBlue
class node_metadata,node_kubeclient,node_metachecks,node_metaready,node_ha toneAmber
class node_tls,node_keystore,node_securityutil toneMint
class node_metrics,node_probes,node_logrotation toneRose
class node_authsimple,node_c_auth,node_operator toneIndigo
```

## Components

### MQ runtime

- [MQ server startup](https://github.com/ibm-messaging/mq-container/blob/master/cmd/runmqserver/main.go): `cmd/runmqserver/main.go`
- [Queue manager lifecycle](https://github.com/ibm-messaging/mq-container/tree/master/cmd/runmqserver): `cmd/runmqserver`
- [Developer setup](https://github.com/ibm-messaging/mq-container/blob/master/cmd/runmqdevserver/main.go): `cmd/runmqdevserver/main.go`
- [MQ health probe](https://github.com/ibm-messaging/mq-container/blob/master/cmd/chkmqhealthy/main.go): `cmd/chkmqhealthy/main.go`
- [MQ readiness probe](https://github.com/ibm-messaging/mq-container/blob/master/cmd/chkmqready/main.go): `cmd/chkmqready/main.go`
- [MQ startup probe](https://github.com/ibm-messaging/mq-container/blob/master/cmd/chkmqstarted/main.go): `cmd/chkmqstarted/main.go`

### Cluster coordination

- [Metadata sidecar](https://github.com/ibm-messaging/mq-container/blob/master/cmd/runmetadataserver/server.go): `cmd/runmetadataserver/server.go`
- [Kubernetes API client](https://github.com/ibm-messaging/mq-container/blob/master/cmd/runmetadataserver/kubeapi/client.go): `cmd/runmetadataserver/kubeapi/client.go`
- [Metadata probes](https://github.com/ibm-messaging/mq-container/blob/master/cmd/chkmetadatahealthy/main.go): `cmd/chkmetadatahealthy/main.go`
- [Metadata readiness check](https://github.com/ibm-messaging/mq-container/blob/master/cmd/chkmetadataready/main.go): `cmd/chkmetadataready/main.go`
- [High availability](https://github.com/ibm-messaging/mq-container/tree/master/internal/ha): `internal/ha`

### Security and configuration

- [TLS configuration](https://github.com/ibm-messaging/mq-container/blob/master/internal/tls/tls.go): `internal/tls/tls.go`
- [Key stores](https://github.com/ibm-messaging/mq-container/blob/master/internal/keystore/keystore.go): `internal/keystore/keystore.go`
- [Security utilities](https://github.com/ibm-messaging/mq-container/blob/master/internal/securityutility/securityutility.go): `internal/securityutility/securityutility.go`

### Observability

- [Prometheus metrics](https://github.com/ibm-messaging/mq-container/tree/master/internal/metrics): `internal/metrics`
- [Probe logging](https://github.com/ibm-messaging/mq-container/blob/master/internal/probes/probesocket.go): `internal/probes/probesocket.go`
- [Log rotation](https://github.com/ibm-messaging/mq-container/blob/master/pkg/logrotation/logrotation.go): `pkg/logrotation/logrotation.go`

### Authentication

- [Developer simple auth](https://github.com/ibm-messaging/mq-container/blob/master/internal/simpleauth/simpleauth.go): `internal/simpleauth/simpleauth.go`
- [MQ simple-auth exit](https://github.com/ibm-messaging/mq-container/blob/master/authservice/mqsimpleauth/src/mqsimpleauth.c): `authservice/mqsimpleauth/src/mqsimpleauth.c`

### Other components

- **Container operator**

## Connections

- Container operator → MQ server startup: runs container (evidence: `README.md`)
- Container operator → Developer setup: selects developer image (evidence: `README.md`)
- Developer setup → MQ server startup: execs (evidence: `cmd/runmqdevserver/main.go`)
- MQ server startup → Queue manager lifecycle: starts
- MQ server startup → High availability: configures (evidence: `cmd/runmqserver/main.go`)
- MQ server startup → Prometheus metrics: configures (evidence: `cmd/runmqserver/main.go`)
- MQ server startup → TLS configuration: configures (evidence: `cmd/runmqserver/main.go`)
- MQ server startup → Developer simple auth: configures (evidence: `cmd/runmqserver/main.go`)
- MQ server startup → Probe logging: starts logging (evidence: `cmd/runmqserver/main.go`)
- Developer setup → Developer simple auth: checks credentials (evidence: `cmd/runmqdevserver/main.go`)
- MQ health probe → Probe logging: logs probe (evidence: `cmd/chkmqhealthy/main.go`)
- MQ readiness probe → Metadata sidecar: sends status (evidence: `cmd/chkmqready/main.go`)
- MQ startup probe → Metadata sidecar: checks status (evidence: `cmd/chkmqstarted/main.go`)
- MQ startup probe → Probe logging: uses probe logging (evidence: `cmd/chkmqstarted/main.go`)
- Metadata sidecar → Kubernetes API client: uses client (evidence: `cmd/runmetadataserver/server.go`)
- Metadata sidecar → Container operator: serves health and status (evidence: `cmd/runmetadataserver/server.go`)
- Metadata probes → Metadata sidecar: checks liveness (evidence: `cmd/chkmetadatahealthy/main.go`)
- Metadata readiness check → Metadata sidecar: checks readiness (evidence: `cmd/chkmetadataready/main.go`)
- TLS configuration → Key stores: creates stores (evidence: `internal/tls/tls.go`)
- Developer simple auth → Security utilities: uses utilities (evidence: `internal/simpleauth/simpleauth.go`)
- MQ simple-auth exit → MQ server startup: provides auth exit
- MQ server startup → Log rotation: configures logging
