• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
The use of the term
event
might be confusingat first. The term is used both to describe anactivity that occurred, and something thatrepresents an activity that occurred in acomputer system. When discussing event processing, it is common to allow theoverloading of the term to continue.Hopefully the context within which the termis used will be sufficient to avoid ambiguity.
Event stream processing with WebSphere eXtremeScale
Level: IntermediateDr. Alan Hopkins (hopkinsa@uk.ibm.com), Senior IT Specialist, IBM
 
03 Sep 2008IBM® WebSphere® eXtreme Scale exposes a rich set of APIs that enable access to data residing withina distributed, resilient, and high performance cache. These APIs support a wide range of application programming patterns. One such pattern enables repeated cache updates to be treated as a temporalsequence of events. Applications written to monitor these event sequences are able to correlate and aggregate patterns of lower level events in order to derive real-time insight into business-significant situations. This articledescribes the implementation of a simple WebSphere eXtreme Scale-based scenario that illustrates the real-time processing of heterogeneous event streams.From IBM WebSphere Developer Technical Journal.
Introduction
A common characteristic of modern enterprise architectures is the inclusion of components procured from different sources, based upon non-consistent foundation technologies, and implemented at different points in time. Not surprisingly, the resultantinfrastructure is often too complex to completely understand at an IT level, let alone at a higher level business abstraction.The occurrence of activities in these disparate subsystems represent the inner workings of today’s modern enterprise, or  beyond. As a result of completely independent threads of execution, these activities will frequently occur in isolation fromeach other. Collectively, these heterogeneous events represent an often untapped source of insight into business threats andopportunities.A common approach to externalizing the occurrence of a significant activitywithin a computer system is via the emission of an event to describe theactivity. The physical representation of the event is of lesser interest at this point. What is important is that activities occurring continuously withinthese heterogeneous subsystems can be made available for analysis from across-subsystem perspective. This set of heterogeneous events is sometimesreferred to as an
event cloud
.IBM WebSphere eXtreme Scale provides the functionality required tocapture and perform real-time analysis of the event cloud. This article presents the implementation of a simple stock portfolio stop loss capability for a Web application. This implementationleverages some of the key capabilities of WebSphere eXtreme Scale that facilitate the real-time processing of heterogeneousevent streams.
Scenario: Stock portfolio stop loss
This example scenario provides a simple stock portfolio stop loss capability. In this scenario, client stock portfoliosencapsulate any number of stocks that might be traded in either US dollars or UK pounds. Portfolio valuations are expressedin UK pounds, and are recalculated dynamically each time an incoming stock ticker event results in a change to a given portfolio stock holding.
Event stream processing with WebSphere eXtreme Scalehttp://www.ibm.com/developerworks/websphere/techjournal/0...1 of 167/23/09 2:15 PM
 
Figure 1. Stock portfolio stop loss scenario
If the aggregate valuation of a portfolio changes by more than 10% on a given trading day, an alert is raised. In this example,the alert is implemented as an informational message written to the system log. (In a more realistic implementation, this alertcould result in a warning rendered on a business monitoring dashboard, or an automated trade to sell some or all of themonitored stock portfolio.)
Essential aspects of WebSphere eXtreme Scale
WebSphere eXtreme Scale provides a runtime platform into which applications with ultra-demanding performance, scalability,and availability requirements can be deployed. A complete discussion of the all the capabilities provided by this technology is beyond the scope of this article, but brief descriptions of some of the capabilities leveraged in this solution are presented below. This information provides a contextual background to help you understand the content of our example scenario. (SeeResources for a complete description of all WebSphere eXtreme Scale capabilities.)
In-memory cache
The central capability provided by WebSphere eXtreme Scale is an in-memory cache that can be partitioned acrosslarge numbers of operating system processes that reside on disparate machines. This distributed cache can beconfigured to provide enterprise class qualities of service such as performance, scalability, and resiliency. From anadministrative perspective, the high-level container for this in-memory cache is the
ObjectGrid
. Within an ObjectGridinstance, data is encapsulated within one or more maps. Application programs can read/write data from/to these mapsin the form of data objects, identified by a unique key. Data integrity is assured by the inherent transactional capabilitiesof WebSphere eXtreme Scale.In order to respond to discrete events in the incoming stock/foreign exchange event streams in our example, you willmake use of an ObjectGrid event listener plug-in. Because this type of plug-in is configured with a scope of anObjectGrid instance, you will use two configured ObjectGrid instances in the present scenario. This lets you achieveisolation with respect to incoming events. Since the data residing within this cache is held entirely within memory, akey benefit of using WebSphere eXtreme Scale is the speed at which operations can be performed against cached data.
Programming models
Event stream processing with WebSphere eXtreme Scalehttp://www.ibm.com/developerworks/websphere/techjournal/0...2 of 167/23/09 2:15 PM
 
WebSphere eXtreme Scale exposes a rich set of APIs that collectively support the access of cached data via a number of application programming patterns. In this scenario, you will exploit two of these patterns:In the first instance, you will use a simple map API to write entries to the cache. The WebSphere eXtreme ScaleMap API is similar to the Java™ Collections Map API in that you essentially write entries identified by a uniquekey to a map object.In addition, you will also use the WebSphere eXtreme Scale Stream Query API to handle data updatesrepresenting continually changing stock and foreign currency exchange rates. This enables updates to aWebSphere eXtreme Scale map to be treated as a temporal event stream. This capability is provided as anextension to the core map capability. Support for event stream handling introduces the concept of a stream mapand a view map. A stream map is used to capture one or more incoming raw event streams. The precise nature of the extraction and aggregation of data elements from the raw data stream that are used to populate the view mapis expressed using Stream Query Language, an SQL-like language that contains specific extensions to facilitatethe explicit processing of temporal event streams. Processing of this raw event stream is handled by the StreamProcessing Technology (SPT) engine. SPT engine output is written to the corresponding stream view map.Figure 2 shows a pictorial representation of the processing flow through these WebSphere eXtreme Scale components.
Figure 2. Event stream processing with WebSphere eXtreme ScaleObjectGrid event listener
WebSphere eXtreme Scale is architected to provide pluggable extension points through which user code can beincorporated. The ObjectGrid event listener extension point enable the incorporation of code that is invoked whensignificant ObjectGrid lifecycle events occur. The sample scenario leverages this capability to introduce code that will be executed every time a transaction is committed against one of the two ObjectGrids that are used here. This pluggableextension point provides the mechanism through which you will incorporate code that dynamically recalculatesaggregate portfolio valuations every time you receive a stock ticker event.
Implementation
Essential elements of this sample scenario are described below. The development of this scenario was performed with thesesoftware product versions:IBM WebSphere Integration Developer Version 6.1 (Java perspective)IBM WebSphere eXtreme Scale Version 6.1IBM Java Runtime Environment Version 1.5.0Although the underlying Java runtime environment in the development scenario was J2SE™, this application should runequally well in an IBM WebSphere Application Server-based environment.
WebSphere eXtreme Scale configuration
Configure WebSphere eXtreme Scale using two complementary configuration files. The first, objectGrid.xml (Listing 1)contains the definition of the two ObjectGrids that are used in this scenario:
StocksGrid
is used to encapsulate incoming event streams that contain foreign exchange and stock ticker events.
Event stream processing with WebSphere eXtreme Scalehttp://www.ibm.com/developerworks/websphere/techjournal/0...3 of 167/23/09 2:15 PM
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...