Files
mq-api-poc/readme.md

79 lines
2.5 KiB
Markdown

## Creating a MQ container
IBM documentation: https://www.ibm.com/docs/en/ibm-mq/9.3?topic=containers-mq-advanced-developers-container-image
If you are using Apple Silicon (M1 or newer) you have to build the image yourself - see [apple-silicon.md](apple-silicon.md)
```bash
# Cleanup previous container
docker stop QM1
docker rm QM1
docker volume rm qm1data
# Create volume and container
docker volume create qm1data
docker run \
--detach \
--env LICENSE=accept \
--env MQ_ADMIN_PASSWORD=passw0rd \
--env MQ_APP_PASSWORD=passw0rd \
--env MQ_DEV=true \
--env MQ_ENABLE_METRICS=true \
--env MQ_QMGR_NAME=QM1 \
--name QM1 \
--publish 1414:1414 \
--publish 9157:9157 \
--publish 9443:9443 \
--restart unless-stopped \
--volume qm1data:/mnt/mqm \
icr.io/ibm-messaging/mq:9.3.5.1-r1
# Activate Swagger UI - edit file in the container
docker exec -it QM1 /bin/bash
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > /mnt/mqm/data/web/installations/Installation1/servers/mqweb/mqwebuser.xml
echo "<server>" >> /mnt/mqm/data/web/installations/Installation1/servers/mqweb/mqwebuser.xml
echo " <featureManager>" >> /mnt/mqm/data/web/installations/Installation1/servers/mqweb/mqwebuser.xml
echo " <feature>apiDiscovery-1.0</feature>" >> /mnt/mqm/data/web/installations/Installation1/servers/mqweb/mqwebuser.xml
echo " </featureManager>" >> /mnt/mqm/data/web/installations/Installation1/servers/mqweb/mqwebuser.xml
echo "</server>" >> /mnt/mqm/data/web/installations/Installation1/servers/mqweb/mqwebuser.xml
endmqweb && sleep 5 && strmqweb
exit
# Restart container
docker restart QM1
```
## Upgrade MQ
```bash
docker stop QM1
docker rm QM1
docker run \
--detach \
--env LICENSE=accept \
--env MQ_ADMIN_PASSWORD=passw0rd \
--env MQ_APP_PASSWORD=passw0rd \
--env MQ_DEV=true \
--env MQ_ENABLE_METRICS=true \
--env MQ_QMGR_NAME=QM1 \
--name QM1 \
--publish 1414:1414 \
--publish 9157:9157 \
--publish 9443:9443 \
--restart unless-stopped \
--volume qm1data:/mnt/mqm \
icr.io/ibm-messaging/mq:9.3.5.1-r1 # Use a newer version.
```
## Webconsole / Swagger UI
* https://localhost:9443/ibmmq/console/#/
* https://localhost:9443/ibm/api/explorer
## Let's play with the API
- [Display QLOCAL](display-qlocal.md)
- [Create QLOCAL](create-qlocal.md)
- [Create QREMOTE](create-qremote.md)
- [Create QALIAS](create-qalias.md)
- [Modify Queue](modify-queue.md)
- [Delete Queue](delete-queue.md)
- [Create Process](create-process.md)
- [Messages - put, get, browse, etc.](messages.md)