Configuring the built-in MQTT pub/sub broker

Configure the built-in MQTT pub/sub broker by using the mqsichangeproperties command, or by updating the configuration file in the work_path\components\integrationNodeName\config directory.

Before you begin

Read the following topics:

About this task

The built-in MQTT broker is enabled by default, and it is the default transport for the publication of operational and admin events by an integration node (unless WebSphere® MQ is installed and a queue manager is specified on the integration node; see Configuring the publication of event messages).

You can modify the configuration of the built-in MQTT broker by using the mqsichangeproperties command. Use the enabled property for the MQTTServer object in the pubsub component to enable or disable the built-in MQTT broker, and the port property to specify the port to be used by the broker. By default, the enabled property is set to true and the port is set to 11883. When an integration node starts, the built-in MQTT broker starts on the port configured by the port property for the MQTTServer object in the pubsub component.
Note: If more than one integration node is configured with the same MQTTServer port, only one MQTT broker will start. All integration nodes that are using the same MQTTServer port, will use the same MQTT broker to publish their events. Subscribers that connect to the MQTT broker receive all the events that are published by the broker, unless the subscriber includes the name of the integration node in their subscriptions.

You can modify the IP address that the MQTT broker process starts by updating the value of bind_address in the configuration file in the work_path\components\integrationNodeName\config directory. By default, the MQTT broker process starts on the same host as the integration node; the default content of the file is bind_address localhost.

You can view the current configuration of the built-in MQTT broker by using the mqsireportproperties command. For example, use the following command to view the port that is used by the built-in MQTT broker:
mqsireportproperties IBNODE -b pubsub -o MQTTServer -n port

Complete the following steps to change the MQTT pub/sub broker port:

Procedure

  1. Use the mqsichangeproperties command to stop the built-in MQTT broker.
    For example:
    mqsichangeproperties IBNODE -b pubsub -o MQTTServer -n enabled -v false 
  2. Use the mqsichangeproperties command to restart the built-in MQTT broker on a port other than the default port.
    For example:
    mqsichangeproperties IBNODE -b pubsub -o MQTTServer -n enabled,port -v true,11885

Results

Note:
When QoS is set to 1 or 2, the default number of messages that are held in queue is 100. If you alter the message count, then you must alter the integrationnode's config file to have the following property:
max_queued_messages count
The maximum number of QoS 1 or 2 messages to hold in the queue above those messages that are currently in flight. The default is 100. Set to 0 for no maximum (this value is not recommended).

The max queued messages count is set in the configuration file. The configuration file used by the bipMQTT can be found under the work_path\components\integrationNodeName\config directory which contains a file with the same name as Integration Node name. For example:

If the Integration Node name is BRK1 and you are running Windows, then a file by name BRK1 is found under C:\ProgramData\Application Data\IBM\MQSI\components\BRK1\config with the following details in it:
bind_address localhost
Use the following steps to alter the built-in configuration:
  1. Stop the Node
  2. Append the following line to the file max_queued_messages <count> - where count is the number of inflight messages to be held
  3. Restart the Node for the built-in mqtt broker to pick up the changes
If more complicated configurations are required, then you should use your own MQTT broker.

What to do next

By default, all event groups except the BusinessEvents group are enabled for MQTT transport. The BusinessEvents group is enabled by default for the MQ pub/sub broker. The BusinessEvents group includes monitoring events. If you want to publish monitoring events to the built-in MQTT broker, you must configure the BusinessEvents group to enable MQTT publication by using the mqsichangeproperties command. For an example, and more information about how to specify a pub/sub broker for specific types of event, see Configuring the publication of event messages.