This article shows how to update the ActiveMQ Runtime Configuration (activemq.xml file elements) using the REST API.
Endpoint
POST /activemq/managers/{nodeName}/{managerName}/runtime-configuration
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
nodeName |
string | Yes | Name of the ActiveMQ node. |
managerName |
string | Yes | Name of the ActiveMQ manager whose runtime configuration is being updated. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
jobDate |
integer | No | Date or timestamp associated with the configuration update job. |
jobTags |
string | No | Tags associated with the configuration update job. |
validateAccessForUser |
string | No | Validates endpoint access for the specified user. |
Request Body
The request body specifies the ActiveMQ configuration changes to apply.
The request can contain the following top-level configuration sections:
| Field | Description |
fileHash |
Hash value associated with the ActiveMQ configuration. |
destinations |
Specifies destination changes. |
destinationPolicies |
Specifies destination policy changes. |
authorizationEntries |
Specifies authorization configuration changes. |
networkConnectors |
Specifies network connector changes. |
alter Property
Configuration objects use the alter property to specify the requested operation.
| Value | Description |
set |
Sets or updates the specified configuration. |
remove |
Removes the specified configuration. |
{
"fileHash": 331215694,
"destinations": [
{
"type": "queue",
"name": "queue1",
"alter": "set"
}
],
"destinationPolicies": [
{
"type": "queue",
"name": "queue1",
"pendingMessageLimitStrategy": {
"name": "constantPendingMessageLimitStrategy",
"attributes": {
"limit": "1000"
}
},
"alter": "set"
}
],
"authorizationEntries": [
{
"type": "queue",
"name": "queue1",
"read": "users",
"write": "admins",
"admin": "admins",
"alter": "set"
}
],
"networkConnectors": [
{
"name": "connector1",
"uri": "static:(tcp://<host>:61616)",
"duplex": true,
"autoStart": true,
"alter": "set"
}
]
}Example Request
curl -X 'POST' \
'http://localhost:8019/rest/v1/activemq/managers/CMACTIVEMQ/Cluster1/runtime-configuration' \
-H 'accept: application/json' \
-H 'Authorization: Basic QWRtaW46YWRtaQ==' \
-H 'Content-Type: */*' \
-d '{
"fileHash": 440048617,
"destinations": [
{
"type": "queue",
"name": "queue1",
"alter": "set"
}
],
"destinationPolicies": [
{
"type": "queue",
"name": "queue1",
"pendingMessageLimitStrategy": {
"name": "constantPendingMessageLimitStrategy",
"attributes": {
"limit": "1000"
}
},
"alter": "set"
}
],
"authorizationEntries": [
{
"type": "queue",
"name": "queue1",
"read": "admins,users,operators",
"write": "admins,operators",
"admin": "admins",
"alter": "set"
}
],
"networkConnectors": [
{
"name": "local-network",
"staticallyIncludedDestinations": [
{
"type": "queue",
"name": "queue1",
"alter": "set"
}
]
}
]
}'Request URL
http://localhost:8019/rest/v1/activemq/managers/MIDDLEWARE4_ACTIVEMQ/ActiveMQ16-1/runtime-configuration
Response Codes
| Status Code | Description |
|---|---|
| 200 | Object changed |
| 304 | Object not changed |
Example Response
-
Success Response (200 OK): Returns the result of the requested ActiveMQ runtime configuration update.
{ "destinations" : [ { "type" : "queue", "name" : "queue1", "alter" : "set", "status" : "ok" } ], "destinationPolicies" : [ { "type" : "queue", "name" : "queue1", "alter" : "set", "status" : "ok" } ], "authorizationEntries" : [ { "type" : "queue", "name" : "queue1", "alter" : "set", "status" : "ok" } ], "networkConnectors" : [ { "name" : "local-network", "status" : "ok" } ] } -
Example Error Response: 304-Object not changed
{ "type" : "pcf", "messageId" : "WGS0024", "message" : "Object not read", "explanation" : "Problem on read object, check PCF code value.", "action" : "Resubmit request with a valid object.", "code" : "115001", "codeStr" : "EXIA_ACTIVEMQ_EXCEPTION", "exception" : "Provided config file hash not equals to existing file (File was modified)" }