Configuring the publication of event messages

You can configure the publication of event messages, including whether messages are published for an event message group, and the pub/sub broker to which the messages are published.

Before you begin

Read the following topics:

About this task

Integration node event messages can be published to the following pub/sub brokers:
  • The built-in MQTT pub/sub broker
  • An MQTT pub/sub broker on an external MQTT server
  • An MQ pub/sub broker
  • A combination of MQ and MQTT pub/sub brokers
The default pub/sub broker that is used for each group of event messages (OperationalEvents, AdminEvents, and BusinessEvents) depends on your IBM® Integration Bus deployment:
WebSphere® MQ is not installed, or WebSphere MQ is installed but a queue manager is not specified on the integration node
By default, the messages are published to the following locations:
  • OperationalEvents messages are published to the built-in MQTT pub/sub broker.
  • AdminEvents messages are published to the built-in MQTT pub/sub broker.
  • BusinessEvents messages are not published.

WebSphere MQ is installed and a queue manager is specified on the integration node
By default, the messages are published to the following locations:
  • OperationalEvents messages are published to the MQ pub/sub broker and the built-in MQTT pub/sub broker.
  • AdminEvents messages are published to the MQ pub/sub broker and the built-in MQTT pub/sub broker.
  • BusinessEvents messages are published to the MQ pub/sub broker.

In either deployment configuration, if you want to publish BusinessEvents messages to the built-in MQTT pub/sub broker, you must explicitly enable the publication of the BusinessEvents group to the built-in MQTT pub/sub broker.

You can change the settings for event publication and the built-in MQTT broker by using the mqsichangeproperties command. You can use mqsichangeproperties to have a specific (local) policy for MQ or MQTT, which can be different for each of the three event message groups.

If you want to use an external MQTT server instead of the built-in MQTT broker, or you are using the MQ pub/sub broker and you want to use a different queue manager to the queue manager that is specified on the integration node, you can use the mqsichangeproperties command to specify a policy that contains the connection details that you want to use. For information about creating policies, see Creating policies by using the command line.

To use a secured MQ pub/sub broker or an MQTT server that requires a user name and password, use the mqsisetdbparms command to define the credentials to use for the connection. If a specific identity is not defined in the configured policy, the integration node uses the security identity pubsubDefault when publishing event messages. If pubsubDefault has been associated with security credentials by using the mqsisetdbparms command, then these credentials are used; otherwise, no credentials are used. For more information, see mqsisetdbparms command.

You can also view the current event configuration by using the pubsub property of the mqsireportproperties command. For example, use the following command to show whether the publication of admin event messages is enabled on the MQTT broker:
mqsireportproperties IBNODE -b pubsub -o AdminEvents/MQTT -n enabled

For details of all the event messages that can be published, see Subscribing to event message topics.

You can configure whether events are published, and where they are published to, by using the mqsichangeproperties command or operational policy.

Follow these steps to configure the publication of event messages:

Procedure

  1. Use the enabled property of the mqsichangeproperties command to enable or disable the publication of event messages by the specified pub/sub broker.
    All integration node events are categorized by event message group (OperationalEvents, AdminEvents, and BusinessEvents), and you can enable or disable the publication of event messages based on the event message group. For example, enter the following command to enable the publication of event messages to an MQTT broker for the publication of BusinessEvents messages:
    mqsichangeproperties IBNODE -b pubsub -o BusinessEvents/MQTT -n enabled -v true
  2. If you want to use an external MQTT server for the publication of event messages, or if you want to use a specific WebSphere MQ queue manager, use the policyUrl property of the mqsichangeproperties command to specify the location of the policy that contains the connection details.
    For example:
    mqsichangeproperties IBNODE -b pubsub -o BusinessEvents/MQTT -n policyUrl -v /apiv1/policy/MQTTPublish/example_mqtt_policy
    For information about creating a policy, see Creating policies by using the command line.
  3. Optional: If the MQTT server or MQ pub/sub broker that you configured in the previous step requires security credentials for connections, use the mqsisetdbparms command to specify these credentials. If you specify a ResourceName of mqtt::pubsubDefault or mq::pubsubDefault, the credentials that you specify are used by the integration node when event messages are published, unless a specific security identity is specified in the configured policy.
    For example, use the following command to specify that the user name myUserID and password myPassword are used when the integration node connects to an external MQTT server for the publication of event messages:
    mqsisetdbparms IBNODE -n mqtt::pubsubDefault -u myUserID -p myPassword
  4. Ensure that the subscription is configured correctly, so that the required event messages are received correctly following the configuration of the publication details.
    For example, if subscription was previously turned off in the web user interface, you must turn it on before published event messages can be received and processed for functions such as message flow statistics.