17.1. Basic features

Softnet supports three categories of events: Replacing, Queueing, and Private. Events must be defined in the Site Structure, where, along with the category, you specify parameters such as name, lifetime, max queue size and access rule. This technique is described in the section “Defining service events”. An event broker hosted on the site implements a queue for each event defined in the Site Structure. The queue of Replacing events can contain only one last event. Each new event replaces the old one. In contrast, each new Queueing event joins the queue of previously received instances. If the queue is full when a new event is received, the oldest one is removed from the tail to make room. The maximum size of a Queueing event queue is specified in the event definition. The queue of Private events works in a similar way. Its maximum size is fixed at 1000. Note that if the site is multi-service, then each queue is created separately for each service.

An event can have arguments. For this purpose, event classes have an arguments field of the SequenceEncoder type, where the type is defined in Softnet ASN.1 Codec, through which services can pass data organized in complex hierarchical structures to subscribers. Accordingly, on the receiving side, events have an arguments field of type SequenceDecoder. The data size in arguments is limited to 2 kilobytes. Before raising an event, an application can check the size by calling the getSize method on arguments.

On the client side, each event has two additional properties that can be useful in event handling. These are age and createdDate. In the age property, Softnet specifies the time elapsed since the event has been received by the broker. This value is zero if the event is sent to the client without delay as soon as it is received by the broker. You can use age, for example, to ignore events that are older than a certain age. In the createdDate property, Softnet specifies the date and time when the event has been received by the broker. Note that Softnet uses the timeline of the Softnet server, not the service application that generated the event, to assign values to both properties.

Pub/Sub Events is a quite complex mechanism. To use it correctly, it is desirable that you understand what event persistence is and how it affects the quality of event delivery. The next sections describe this issue in detail.


TABLE OF CONTENTS