MessageBus component

August 2, 2023

ID messagebus_component

The MessageBus component implements the message bus that ensures receipt, distribution and delivery of messages between applications running KasperskyOS. This bus is based on the publisher-subscriber model. Use of a message bus lets you avoid having to create a large number of IPC channels to connect each subscriber application to each publisher application.

Messages transmitted through the MessageBus cannot contain data. These messages can be used only to notify subscribers about events. See "Message structure" section below.

The MessageBus component provides an additional level of abstraction over KasperskyOS IPC that helps simplify the development and expansion of application-layer applications. MessageBus is a separate program that is accessed through IPC. However, developers are provided with a MessageBus access library that lets you avoid direct use of IPC calls.

The API of the access library provides the following interfaces:

  • IProviderFactory provides factory methods for obtaining access to instances of all other interfaces.
  • IProviderControl is the interface for registering and deregistering a publisher and subscriber in the bus.
  • IProvider (MessageBus component) is the interface for transferring a message to the bus.
  • ISubscriber is the callback interface for sending a message to a subscriber.
  • IWaiter is the interface for waiting for a callback when the corresponding message appears.

Message structure

Each message contains two parameters:

  • topic is the identifier of the message subject.
  • id is an additional parameter that identifies a particular message.

The topic and id parameters are unique for each message. The interpretation of topic+id is determined by the contract between the publisher and subscriber. For example, if there are changes to the configuration data used by the publisher and subscriber, the publisher forwards a message regarding the modified data and the id of the specific entry containing the new data. The subscriber uses mechanisms outside of the MessageBus to receive the new data based on the id key.

In this section

IProviderFactory interface

IProviderControl interface

IProvider interface (MessageBus component)

ISubscriber, IWaiter and ISubscriberRunner interfaces

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.