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

About this task

  • You need to enable your required publication of events as follows:

    For Operational Events or Statistics and Accounting, use the mqsichangeflowstats command or set Statistics.Snapshot.publicationOn / Statistics.Archive.archivalOn in the .conf.yaml file.

    For Business Events or Message Flow Monitoring, use the mqsichangeflowmonitoring command or set Monitoring.MessageFlow.publicationOn in the .conf.yaml file.

    Integration node and independent integration server event messages can be published to the following destinations:
    • The default IBM MQ queue manager of an integration node or independent integration server
    • The integration node MQTT pub/sub broker (not available for independent integration servers)
    • An external IBM MQ queue manager, by configuring an MQEndpoint policy
    • An external MQTT pub/sub broker, by configuring an MQTTPublish policy
    You can configure both IBM MQ and MQTT pubs/sub brokers.
    The default pub/sub broker that is used for each group of event messages (OperationalEvents and BusinessEvents) depends on your IBM® App Connect Enterprise deployment:
    IBM MQ is not installed, or IBM 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.
    • BusinessEvents messages are not published.

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

    In either 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 the publication of OperationalEvents and BusinessEvents, and the integration node built-in MQTT broker, either by using the mqsichangeproperties command or by editing the node.conf.yaml or server.conf.yaml configuration file. You can configure specific IBM MQ or MQTT connection policies, for each of the OperationalEvents and BusinessEvents event message groups.

    If you want to use an external MQTT server instead of the built-in MQTT broker, you can create a policy that contains the connection details that you want to use. For more information about creating policies, see Creating policies with the IBM App Connect Enterprise Toolkit.

    If you want to use the IBM MQ pub/sub broker and you want to use a different queue manager to the queue manager that is specified on the integration server, you can create a policy that contains the connection details that you want to use. For more information about creating policies, see Creating policies with the IBM App Connect Enterprise Toolkit.

    To use a secured IBM MQ pub/sub broker or an MQTT server that requires a username 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 event messages are published. If pubsubDefault is 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.

    For more information about 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, either by using the mqsichangeproperties command, or by setting properties in the server.conf.yaml or node.conf.yaml configuration file. Configure the publication of events by completing the steps in one of the following tasks:

Using the mqsichangeproperties command

About this task

Follow these steps to configure the publication of event messages by using the mqsichangeproperties command:

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 and BusinessEvents). You can enable or disable the publication of event messages that are 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 INODE -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 IBM MQ queue manager, use the policy property of the mqsichangeproperties command. You can use the policy to specify the location of the policy that contains the connection details.
    For example,
    mqsichangeproperties INODE -b pubsub -o BusinessEvents/MQTT -n policy -v {DefaultPolicies}:example_mqtt_policy
  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 security identity is specified in the configured policy.
    For example, use the following command to specify that the username myUserID and password myPassword are used when the integration node connects to an external MQTT server for the publication of event messages:
    mqsisetdbparms INODE -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. For example, message flow statistics.

Modifying the server.conf.yaml or node.conf.yaml file

About this task

Follow these steps to configure the publication of event messages by setting properties in the server.conf.yaml or node.conf.yaml configuration file:

Procedure

  1. Use a YAML editor to open the .yaml file.

    If you do not have access to a YAML editor, you can edit the file by using a plain text editor. However, you must ensure that you do not include any tab characters, which are not accepted in YAML and would cause your configuration to fail. If you choose to use a plain text editor, ensure that you use a YAML validation tool to validate the content of your file.

    For more information about working with YAML, see http://www.yaml.org/start.html.

  2. Set the appropriate property values in the Events section of the .yaml file:
    Events:
      OperationalEvents: # Message flow and Resource statistics plus Workload management
        MQ:
          #policy: ''      # Specify a {policy project}:policy if not using  'defaultQueueManager'
          #enabled: true   # Set true or false, default false
          #format: ''      # Set string or none
        MQTT:
          #policy: ''      # Specify a {policy project}:policy
          #enabled: false  # Set true or false, default false
          #format: ''      # Set string or none
      BusinessEvents:    # Business monitoring events
        MQ:
          #policy: ''      # Specify a {policy project}:policy if not using  'defaultQueueManager'
          enabled: true    # Set true or false, default false
          #format: ''      # Set string or none
        MQTT:
          #policy: ''      # Specify a {policy project}:policy
          #enabled: true   # Set true or false, default false
          #format: ''      # Set string or none
  3. Save the changes to the .yaml file.
  4. Restart the integration node or integration server for the changes to take effect. The properties that you set in the .yaml file take effect when the integration node or server is started. If you modify these properties again, you must also start the integration node or server again for the later changes to be applied.