Simple Event Envelope

From MemberWiki

Jump to: navigation, search



This page proposes an OPTIONAL envelope specification for use with the Hub. This is called the Simple Event Envelope.

The envelope would look roughly like this:

    publisherId: {string},
        // OPTIONAL. Id that identifies publisher of this event

    bodyType: {string},
        // Datatype name of the body property
    body: {any},
        // The actual data payload

    v: "1.0"
        // SEE specification version number

While publishers and subscribers would not be forced to use Simple Event Envelopes, using them would have various benefits. Some basic use cases are described below.

The publisherId Property

In some situations, a "bridge" is used to connect two hubs with each other. The bridge is configured to forward traffic on some topics from Hub 1 to Hub 2, and to forward traffic on some topics from Hub 2 to Hub 1. Traffic on some topics may be forwarded in both directions, leading to the risk of cycles.

A bridge may use the optional publisherId property to help it avoid cycles.

Bridges have reared their heads on a number of occasions, including:

  • Bridges between OpenAjax Hub and other types of event systems. E.g. one early OpenSocial integration approach used a bridge.
  • A client application with a private ManagedHub also contains a bridge to forward a subset of the traffic on the private hub to/from a mash-up's ManagedHub.

Security note: while publisherId could be viewed as a claim of identity, it is not an authenticated claim. The Hub does not make any effort to verify the authenticity of publisherId properties, and a bridge may in fact add its own publisherId property to an event that it republishes, or even overwrite the existing publisherId; so subscribers should not assume that publisherId reliably identifies the true origin of the event.

Publisher Ids should be unique.

The bodyType Property

The bodyType identifies the type of the body object. This allows a subscriber that receives an event to identify the type of the body object before it starts to process it.

In version 1.0, of SEE, the type name corresponds to the OpenAjax Metadata 1.0 type name.

This is useful because if an event is allowed to contain one of several different datatypes, there is currently no standard way to introspect the event and determine which of several possible data types it contains.

The body Property

This is the actual payload data.

The v Property

This is the version number for the SEE specification. The value of this property MUST be "1.0".

Personal tools