MessageBus Event Nodes

MessageBus events facilitate communication across Kit. MessageBus signals can originate from many sources (e.g., python extension) and support cross-component communication in Kit.

In this example, messageBus events are used to send data between graphs and from outside of Kit (e.g., web page) into a graph.

MessageBus Analogy

Imagine a crowded room of people. Each person in the room has a note card with a word on it. Their job is to either shout out the word on their note card, or listen for someone to shout the word on their note card. When a word is shouted, every listener in the room with a matching word on their note card approaches the person who shouted and is handed an envelope. Inside that envelope are several pieces of paper with different types of information on them. The listeners then return to their desk to do their respective jobs with what is inside the envelope they were given. In this analogy, you can see the basic structure of how the MessageBus works.

  • A listener is an “On MessageBus Event” node.

  • A shouter is a “Send MessageBus Event” node.

  • The note cards have the EventName written on them. These are the words being shouted in the room.

  • The envelopes contain the attributes on the nodes, and are being passed on using the messageBus.

On MessageBus and Send MessageBus Node

Using defined sets of eventNames and configuring ports on the nodes to match enables passing any combination of data around the graphs. This system allows for versatile data exchange, supporting complex interactions and workflows. Refer to the Message Bus Event Tutorial for a detailed walkthrough of how to configure and use the messageBus event nodes. In the example file, messageBus nodes can found in all the graphs that relate to changing variants such as \Graphs\Wheels and \Graphs\CarColors.

../_images/message-bus_1.png

Event Name

The name of the event. This is case-sensitive. When an eventName is sent, any “On MessageBus” event node setup with the same name ANYWHERE else in the stage (even in other graphs) triggers their execution outputs and starts their downstream graphs. If they have matching data setup on their ports, they pass it through to each event node.

Note: MessageBus events can originate from outside the graphs as well, since they are part of the underlying Kit APIs. Thus, an extension, a python snippet, an external website or app, any of these can send messageBus events.

Add+

Adds custom attributes to send and receive across the event. This is case-sensitive and requires attribute name and dataType selection.

If a messageBus is sent or received with missing or extra data than it is configured for, the messageBus nodes discard or ignored the unmatched data and still successfully compute.

Remove-

Removes existing MessageBus attributes.

Review the following resources for more information on implementing custom messaging in an external application: