New commands have been added to IBM MQ in version 9.0.4 to make configuring the mqweb server easier. The mqweb server is the server that is used for the REST API and MQ Console features, and configuring the server enables you to customize properties such as timeouts for the REST API and MQ Console.
Previously, in order to change the configuration you had to manually edit the xml in the mqwebuser.xml file. This meant that on the IBM MQ Appliance, it was impossible to change properties from the default values as the mqwebuser.xml file isn’t accessible. On other platforms, there was a risk of introducing errors to the xml file, or creating duplicate entries.
Now, you can use setmqweb properties to configure a subset of properties, and use dspmqweb properties to display either the properties that have been changed from the defaults, or the entire set of properties that are configurable via setmqweb properties. What’s more, you can use the dspmqweb status command to display information about whether the mqweb server is running. If it’s running, the command displays information about the root context URLs and ports that are used by the IBM MQ Console and REST API. These commands work across all platforms.
Configurable mqweb server properties
Here are all the properties you can configure:
- The LTPA token expiration time
- The maximum number of trace files generated by the mqweb server
- The maximum size of the trace files generated by the mqweb server
- The CORS origins that are allowed to access the REST API
- The maximum length of time that a browser is allowed to cache the results of any CORS pre-flight checks
- Whether CSRF validation checks are performed
- The CSRF token expiration time
- Whether the REST API gateway is enabled
- The name of the queue manager that is used as a gateway to remote queue managers
- Whether REST API messaging is enabled
- The REST API request timeout
- The trace specification generated by the mqweb server
In addition, on all platforms except the IBM MQ Appliance, you can configure these properties:
- The HTTP host name used by the mqweb server
- The HTTP port used by the mqweb server
- The HTTPS port used by the mqweb server
- Whether the IBM MQ Console is automatically started
- Whether the REST API is automatically started
Note that although you can’t edit the mqwebuser.xml file on the IBM MQ Appliance, it’s still possible to configure the HTTPS port that is used by configuring the REST management interface. The Knowledge Center has more details here: Configuring the REST management interface.
Setting mqweb server properties
The setmqweb properties command can be used to set individual properties, to delete non-default values, or to reset all the values to the defaults.
For example, to set the LTPA token expiration time to 300 seconds, you’d use this command:
setmqweb properties -k ltpaExpiration -v 300
To delete this value, you’d use this command:
setmqweb properties -k ltpaExpiration -d
Or to reset all the values, you’d use this command:
setmqweb properties -r
For the full details about setmqweb properties, and how to use it, check out this topic in the IBM Knowledge Center: setmqweb.
Displaying mqweb server properties
With the dspmqweb properties command, you can display either a subset of properties that have been changed from the defaults, or all the properties. You can also choose to view the properties as name and value pairs, or as command text which you can then use as input for the setmqweb properties command.
For example, to view all the configurable properties, in the default output as command text, you’d use this command:
To view just the properties that have been changed from the default, you’d use this command:
dspmqweb properties -u
For the full details about dspmqweb properties, and how to use it, check out this topic in the IBM Knowledge Center: dspmqweb.
Configuring other mqweb server properties
For all other mqweb server configuration, the configuration method is unchanged.
This means that on the IBM MQ Appliance, you configure users and groups on the appliance with access to the appropriate resources. i.e. access to the
mq/webuser resource, and read access to the
login/rest-mgmt resource. There’s more information about this in the Knowledge Center here: Administering IBM MQ by using the REST API.
On other platforms, you configure users and groups by manually editing the mqwebuser.xml file. There’s more detail on how to do this, including information about the types of roles users can have, in the Knowledge Center: Configuring users and roles for the MQ Console and REST API.
If you’ve yet to try the REST API and want to get started quickly, take a look at Getting started with the REST API, delve into the reference information available here, and try out the setmqweb properties and dspmqweb properties commands!