Compare commits

...

5 Commits

Author SHA1 Message Date
8a541cafa2 Add information regarding Apple Silicon 2024-05-04 00:06:04 +02:00
8641701ee4 Update create-qlocal.md 2024-05-02 09:41:58 +02:00
b2311f7e11 Updated 2024-04-30 00:43:46 +02:00
db424f620d Updated examples 2024-04-30 00:41:28 +02:00
326f683e64 Added MQ upgrade 2024-04-29 18:37:44 +02:00
4 changed files with 162 additions and 32 deletions

31
apple-silicon.md Normal file
View File

@@ -0,0 +1,31 @@
# Building MQ container for Apple Silicon (ARM64)
Build it locally
```bash
git clone https://github.com/ibm-messaging/mq-container.git
cd mq-container
make build-devserver
```
Look at the output - specifically the last line.
```bash
...
=> => naming to docker.io/library/ibm-mqadvanced-server-dev:9.3.5.1-arm64 0.0s
```
Use this image instead of the one from icr.io
~~icr.io/ibm-messaging/mq:9.3.5.1-r1~~
docker.io/library/ibm-mqadvanced-server-dev:9.3.5.1-amd64
Return to [readme.md](readme.md).
## Building a newer/older version
Edit the version number in `config.env`.
If IBM released a newer versinon, you might also pull down changes from github.
```bash
cd mq-container
git pull
```

View File

@@ -1,17 +1,75 @@
## POST /ibmmq/rest/v1/admin/qmgr/{qmgrName}/queue ## POST /ibmmq/rest/v1/admin/qmgr/{qmgrName}/queue
```bash ```bash
# New queue from scratch # New queue from scratch
curl --insecure --header 'Content-Type: application/json' \ curl -X POST 'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue' \
-X POST --header 'Accept: application/json' \ --insecure \
-d '{ \ --header 'Content-Type: application/json' \
"name": "RLN.TEST.QUEUE", \ --header 'Accept: application/json' \
"type": "QLOCAL" \ --header 'ibm-mq-rest-csrf-token: value' \
}' \ -u admin:passw0rd \
'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue' --data-binary @- << EOF
{
"name": "API.QUEUE.1",
"type": "local"
}
EOF
```
## POST /ibmmq/rest/v1/admin/qmgr/{qmgrName}/queue&like={existing queue name}
```bash
# New queue like DEV.QUEUE.1 # New queue like DEV.QUEUE.1
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ curl -X POST 'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue?like=DEV.QUEUE.1' \
"name": "RLN.TEST.QUEUE", \ --insecure \
"type": "QLOCAL" \ --header 'Content-Type: application/json' \
}' 'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue?like=DEV.QUEUE.1' --header 'Accept: application/json' \
``` --header 'ibm-mq-rest-csrf-token: value' \
-u admin:passw0rd \
--data-binary @- << EOF
{
"name": "API.QUEUE.2",
"type": "local"
}
EOF
```
## POST /ibmmq/rest/v1/admin/qmgr/{qmgrName}/queue&like=<existing queue name>
```bash
# New queue like DEV.QUEUE.1 replacing a few values
curl -X POST 'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue?like=DEV.QUEUE.1' \
--insecure \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'ibm-mq-rest-csrf-token: value' \
-u admin:passw0rd \
--data-binary @- << EOF
{
"name": "API.QUEUE.3",
"type": "local",
"storage": {
"maximumDepth": 10,
"pageSet": 5,
"maximumMessageLength": 50,
"messageDeliverySequence": "FIFO"
},
"trigger": {
"depth": 1,
"processName": "API.QUEUE.2.PROCESS",
"enabled": true
},
"events": {
"depth": {
"lowPercentage": 0,
"highPercentage": 0,
"lowEnabled": true,
"fullEnabled": true,
"highEnabled": true
}
}
}
EOF
```
## Expected result
Status: 201 Created
Status: 400 Bad Request

View File

@@ -1,20 +1,24 @@
### GET /ibmmq/rest/v1/admin/qmgr/{qmgrName}/queue ## GET /ibmmq/rest/v1/admin/qmgr/{qmgrName}/queue
```bash ```bash
# Get all queues # Get all queues
curl -X GET \ curl -X GET 'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue' \
--insecure --header 'Accept: application/json' \ --insecure \
-u admin:passw0rd \ --header 'Accept: application/json' \
'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue' -u admin:passw0rd
```
## GET /ibmmq/rest/v1/admin/qmgr/{qmgrName}/queue?name={queue name or wildcard}
```bash
# Get all DEV* queues # Get all DEV* queues
curl -X GET \ curl -X GET 'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue?name=DEV*' \
--insecure --header 'Accept: application/json' \ --insecure \
-u admin:passw0rd \ --header 'Accept: application/json' \
'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue?name=DEV*' -u admin:passw0rd
``` ```
## Expected output ## Expected output
### Search for all queues, or queues that does exist. ### A search for all queues, or queues that does exist.
Status: 200 OK Status: 200 OK
```json ```json
{ {
@@ -39,7 +43,7 @@ Status: 200 OK
} }
``` ```
### Search for queue that doesn't exist ### A search for queue that doesn't exist
Status: 200 OK Status: 200 OK
```json ```json
{ {

View File

@@ -1,6 +1,9 @@
## Creating a MQ container ## Creating a MQ container
IBM documentation: https://www.ibm.com/docs/en/ibm-mq/9.3?topic=containers-mq-advanced-developers-container-image 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 ```bash
# Cleanup previous container # Cleanup previous container
docker stop QM1 docker stop QM1
@@ -21,22 +24,56 @@ docker run \
--publish 1414:1414 \ --publish 1414:1414 \
--publish 9157:9157 \ --publish 9157:9157 \
--publish 9443:9443 \ --publish 9443:9443 \
--restart unless-stopped \
--volume qm1data:/mnt/mqm \ --volume qm1data:/mnt/mqm \
icr.io/ibm-messaging/mq:latest icr.io/ibm-messaging/mq:9.3.5.1-r1
# Inside the container # Activate Swagger UI - edit file in the container
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > /mnt/mqm/data/web/installations/Installation1/servers/mqweb/mqwebuser.xml docker exec -it QM1 /bin/bash
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 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > /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 "<server>" >> /mnt/mqm/data/web/installations/Installation1/servers/mqweb/mqwebuser.xml
echo " </featureManager>" >> /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 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 endmqweb && sleep 5 && strmqweb
exit exit
# Restart container # Restart container
docker restart QM1 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 ## Webconsole / Swagger UI
* https://localhost:9443/ibmmq/console/#/ * https://localhost:9443/ibmmq/console/#/
* https://localhost:9443/ibm/api/explorer * 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)