Enabling the messaging REST API

You can configure whether the messaging REST API is enabled by using the setmqweb command. By default, the messaging REST API is enabled.

Before you begin

To complete this task, you must be a user with certain privileges so that you can use the dspmqweb and setmqweb commands:
  • [z/OS]On z/OS®, you must have authority to run the dspmqweb and setmqweb commands, and write access to the mqwebuser.xml file.
  • [UNIX, Linux, Windows, IBM i]On all other operating systems, you must be a privileged user.
  • [MQ 9.4.0 Jun 2024][Linux]If the mqweb server is part of a stand-alone IBM® MQ Web Server installation, you must have write access to the mqwebuser.xml file in the IBM MQ Web Server data directory.
Attention:

Before you issue either the setmqweb or dspmqweb commands on z/OS, you must set the WLP_USER_DIR environment variable so that the variable points to your mqweb server configuration.

To set the WLP_USER_DIR environment variable, issue the following command:
export WLP_USER_DIR=WLP_user_directory
where WLP_user_directory is the name of the directory that is passed to crtmqweb. For example:
export WLP_USER_DIR=/var/mqm/web/installation1

For more information, see Create the mqweb server.

Procedure

  • View the current configuration of the messaging REST API by using the following command:
    dspmqweb properties -a
    The mqRestMessagingEnabled field shows whether the messaging REST API is enabled. If the value is True the messaging REST API is enabled.
  • Enable the messaging REST API by using the following command:
    setmqweb properties -k mqRestMessagingEnabled -v true
  • Disable the messaging REST API by using the following command:
    setmqweb properties -k mqRestMessagingEnabled -v false