Configuring the built-in MQTT pub/sub broker
Configure the built-in MQTT pub/sub broker for an integration node, by using the mqsichangeproperties command, or by updating the configuration file in the work_path\components\integrationNodeName\config directory.
Before you begin
About this task
- IBM® MQ is installed.
- An IBM MQ queue manager is specified on the integration node.
The built-in MQTT pub/sub broker is only applicable to an integration node. If you want to publish event messages for an independent integration server, you must configure an MQTTPublish policy to use an external MQTT pub/sub broker. For more information, see Configuring and subscribing to performance and monitoring events.
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 pub/sub 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 that is configured by the port property for the MQTTServer object in the pub/sub component.
If more than one integration node is configured with the same MQTTServer port, only one MQTT broker starts. All integration nodes that are using the same MQTTServer port, 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
.
mqsireportproperties INODE -b pubsub -o MQTTServer -n port
Complete the following steps to change the MQTT pub/sub broker port:
Procedure
Results
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 advised).The value of max_queued_messages count is set in the configuration file. The configuration file that is 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,
bind_address localhost
Use the following steps to
alter the built-in configuration:- Stop the Node.
- Append the following line to the
file.
Where count is the number of inflight messages to be held.max_queued_messages <count>
- Restart the Node for the built-in MQTT broker to pick up the changes.
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 IBM 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.