Sunday, September 13, 2009

On event channels

Last week, the Disney Channel arrived to the Israeli cable system and enriched the set of already existing children channels; so speaking about channels, it is a good time to discuss another type of channel -- an event channel, which is discussed in chapter 6 of the EPIA book draft. Some people view channel as an edge in the event processing graph, but we view channel as a type of node, since it has some processing associated with it. We define a channel as a processing element that receives events from one or more source processing elements (We refer to EPA, producer and consumer as processing elements), makes routing decisions, and sends the input events unchanged to one or more target processing elements in accordance with these routing decisions. Note that like the term Event Processing Agent, channels are abstractions and can be implemented in various ways (e.g. through messaging systems, through buffers, through persistent stores etc...). Channels are classified according to their routing schemes. Some of the common routing schemes are:
  • Fixed routing scheme: The channel has predefined input terminals wired to predefined processing elements, and predefined output terminals wired to predefined processing elements. Every event that is received on any input terminals is sent to all output terminals. Note that this type of channels can be defined implicitly.
  • Subscription-based: EPAs or consumers can subscribe to the channel dynamically. The routing decision is determined according to the list of subscribers that is valid at the time that a decision is made.
  • Itinerary-based: The sink's input terminal identifier or identifiers are obtained from some attribute in the event's payload, this is used to send an event to a specific consumer instance, when the EPN node is the consumer class.
  • Context-based: The channel makes routing decisions based on the context to which the EPA belongs. This is applicable for pattern detection ("complex event processing") type of EPA. The channel selects the appropriate run-time EPA based on the context defined in the pattern- I'll discuss contexts in length in one of the next postings, as this is the topic of the next chapter in the book.
  • Type-based: The channel makes routing decisions based on the event type of the event that is being routed.
  • Content-based: The routing decision is based on the event's content, this can be phrased as assertions, rules, decision trees or decision tables, and are based on the input event content, as well as context information.

This is just the basic definition, in one of the next postings I'll show example of how all these concepts fit together.

2 comments:

Zbigniew Jerzak said...

Hi Opher,

I do not quite understand the concept of the subscription-based channel.

In order to create a subscription channel one would need another existing channel, say between A and B (A->B). A third process C, could than subscribe to the A->B channel, making A send its data to both B and C. However, what can B subscribe to? Is there a "potential channel" at A which does not send data and B could subscribe to? Or is it not possible to create such channel without any other channels existing a priori?

Cheers,

Opher Etzion said...

Hi Zbiginiew, there are too many channels in your question. It is somewhat simpler. EPA or producer can emit event to a channel, the channel then send it to consumers. In the model it sends it to a single consumer node called "subscriber", which is actually a proxy for a dynamic list of subscribers. Whoever exists in this list at the time that an event is routed through this channel get this event, so the channel is between the event producer (A) and the list of subscribers (B).