Receiving Message Bus Events

Solace PubSub+ event brokers can be configured to generate events that provide management and status information and publish them as direct messages to well-known topics onto the event broker message bus.

The following types of event messages can be published to the message bus:

  • System—events that have an event broker- or system-wide scope (that is, they are events that concern the entire event broker—they are not limited to a Message VPN or particular client). Examples of system scope events are fan alarms, hardware failure events, and so on. Refer to Publishing System Events.
  • Message VPN—events pertain to a particular Message VPN. An example of a Message VPN event is a message rate event that is generated when the set message rate threshold for a given Message VPN is exceeded. (Refer to Publishing Message VPN Events.)
  • Client—events that pertain to client connections to particular Message VPN. These could be events such as client connects and disconnects. Client event messages are only sent out on the Message VPN in which the event occurred. (Refer to Publishing Client Events.)
  • Subscription—events that pertain to client topic subscriptions added to or removed from the Message VPN. Subscribe and unsubscribe event messages are only sent out on the Message VPN in which the event occurred. (Refer to Publishing Subscription Events.)

Management applications using the Solace messaging APIs can receive these event messages by subscribing to specific topics that the events are published to (these topics are listed in the Summary of Standard Event Message Topics and Text table).

For a detailed listing of the possible events and descriptions of each event, refer to Syslog Event Reference.

Configuring Event Broker Event Publishing

To be able to receive event messages published over the event broker message bus, the publishing of events over the event broker message bus must be enabled. Additional event configuration changes for the publishing of event messages can also be made.

Publishing System Events

By default, the publishing of system event messages over the event broker message bus is not enabled.

To enable an event broker to publish system event messages, a Message VPN that currently has an enabled state must be configured as the Management Message VPN. (Only one Message VPN can be configured as the Management Message VPN.) Once a Management Message VPN is configured, system event messages will then always be published to that Management Message VPN. (If no Management Message VPN is configured, then system event messages are not published for the event broker.)

Once a Management Message VPN is configured, the publishing of system-level event messages must be enabled.

  • To set a Message VPN as the Management VPN, enter the following CONFIG command:

    solace# configure
    solace(configure)# management-message-vpn <vpn-name>

    Where:

    <vpn-name> is the name of the Message VPN to be designated as the Management Message VPN.

    The no version of the command (no management-message-vpn) removes the Management Message VPN designation from the Message VPN.

  • To turn on the publishing of system event messages, use the following Logging Event CONFIG command:

    solace(configure)# logging event
    solace(configure/logging/event)# publish-system

    The no version of the command (no publish system) turns off the publishing of system event messages.

  • To view the current status of the system scope configuration, enter the following User EXEC command.

    Example:

    solace(configure/logging/event)# show logging event

    System-tag:

    Publish System Event Messages: Disabled

Publishing Message VPN-Level Events

By default, the publishing of Message VPN, client, and subscription event messages over the event broker message bus is not enabled, and must be enabled for each type you want to enable on a Message VPN by Message VPN basis.

If the publishing of Message VPN, client, and/or subscription event messages over the event broker message bus is not enabled, the events are still written to syslog.

The event messages for these event types can be published to the message bus in the Message VPN in which the event occurred.

Publishing Message VPN Events

To turn on Message VPN event publishing for a Message VPN, enter the following CONFIG commands:

solace(configure)# message-vpn <vpn-name>
solace(configure/message-vpn)# event
solace(configure/message-vpn/event)# publish-message-vpn

The no version of the command (no publish-message-vpn) turns off the publishing of Message VPN event messages for the given Message VPN.

Setting a Topic Format for Published Events

By default, all event logs for an event broker are published to a topic that is prefixed by #LOG/.

However, in Message Queuing Telemetry Transport (MQTT) topic syntax, the “#” character is reserved as a “zero or more levels” wildcard. Therefore, for an application to receive published event logs using an MQTT session subscription, you must configure the event broker to publish event logs to a topic that is compatible with MQTT subscriptions.

To set the topic format for published events for a Message VPN, enter the following CONFIG command:

solace(configure/message-vpn/event)# publish-topic-format [smf] [mqtt]

Where:

smf specifies that events should be published using SMF topic syntax, with the format #LOG/<log-level>/<event-specific-content>. This is the default topic format used for published event logs.

mqtt specifies that events should be published using MQTT topic syntax, with the format $SYS/LOG/<log-level>/<event-specific-content>.

  • At least one option must be specified. If both formats are specified, event logs will be published using each of the specified topic formats.
  • The no version of this command (no publish-topic-format) resets the parameter to its default value of smf only.

Publishing Client Events

To turn on client event publishing for a Message VPN, enter the following CONFIG commands:

solace(configure)# message-vpn <vpn-name>
solace(configure/message-vpn)# event
solace(configure/message-vpn/event)# publish-client

The no version of the command (no publish-client) turns off the publishing of client scope events for the given Message VPN.

Publishing Subscription Events

To turn on subscription add/delete event message publishing for a Message VPN, enter the following CONFIG commands:

solace(configure)# message-vpn <vpn-name>
solace(configure/message-vpn)# event
solace(configure/message-vpn/event)# publish-subscription [no-unsubscribe-events-on-disconnect] [event-topic-format {v1 | v2}]

Where:

no-unsubscribe-events-on-disconnect configures the publishing of subscription events to disregard unsubscribe events for each of a client’s subscriptions when the client disconnects.

event-topic-format v1 sets the topic structure of subscription events to the form #LOG/INFO/SUB_ADD|SUB_DEL/<subscribedTopic>

event-topic-format v2 sets the topic structure of subscription events to the form #LOG/INFO/SUB/<routerName>/ADD|DEL/<vpnName>/<clientName>/<subscribedTopic>

  • The no version of the command (no publish-subscription) turns off the publishing of subscription add/delete event messages for the given Message VPN.
  • Enabling the publishing of subscription-level events to the message bus in a Message VPN may affect subscription performance on the event broker.
  • Subscription event topics should not exceed the maximum topic string length. Topics strings that exceed the maximum length will be truncated. For more information on topic structure, refer to Topic Support & Syntax.

Viewing VPN Event Publishing Configuration

The current event publishing configuration and status for a Message VPN can be viewed through the show message-vpn User EXEC command.