Distributed Complex Event Processing / Event Stream Processing

Topics: Technical Support
Nov 18, 2013 at 7:01 AM
Is it possible to add Complex Event Processing / Event Stream Processing capabilities?

Perhaps this can be done through Rx
Coordinator
Nov 18, 2013 at 10:33 AM
Edited Nov 18, 2013 at 10:36 AM
Please give me an example of what you're talking about. What is complex event processing?

Zyan supports events out of the box. It tries its best to make distributed events look and behave exactly like normal local .NET events. So you should be able to do just everything you would do with normal events. For example, use Observable.FromEventPattern to wrap around your proxy's event. Here is an example:
// client-side code
using (var conn = new ZyanConnection(url, protocol))
{
    // create a proxy and an ordinal event handler
    var proxy = conn.CreateProxy<ISampleService>();
    proxy.RandomEvent += (s, e) => Console.WriteLine("Random event ocured.");

    // create RX observable with throttle option
    var observable = 
        Observable.FromEventPattern<EventArgs>(proxy, "RandomEvent")
            .Throttle(TimeSpan.FromSeconds(1));

    observable.Subscribe(e =>
    {
        Console.WriteLine("Occured later than 1 second after the last event.");
    });

    // let server start sending events to our proxy
    proxy.RaiseRandomEvents();
    Console.ReadLine();
}
Full code for the example console program is available here: https://gist.github.com/yallie/7525678
To compile the sample using console C# compiler, run
csc rxtest.cs /r:Zyan.Communication.dll /r:System.Reactive.Core.dll /r:System.Reactive.Linq.dll /r:System.Reactive.Interfaces.dll /r:System.Runtime.dll /r:System.Threading.Tasks.dll
The first run of the application starts the server. The second run starts the client.
The client connects to the server using IPC protocol and displays events generated by server.
It uses Observable class to aggregate and filter remote events.
Here is the sample output of the console client program:
Connected to server. Press ENTER to quit.
Random event ocured.
Random event ocured.
Random event ocured.
Random event ocured.
Occured later than 1 second after the last event.
Random event ocured.
Occured later than 1 second after the last event.
Random event ocured.
Occured later than 1 second after the last event.
Random event ocured.
Random event ocured.
Random event ocured.
Random event ocured.
Occured later than 1 second after the last event.
Let me know if it answers your question.
Nov 19, 2013 at 1:16 PM
Coordinator
Nov 19, 2013 at 1:57 PM
Edited Nov 19, 2013 at 3:46 PM
Hi sirinath.

Since I've got no specific answers from you so far, I assume that you've got no real-world use case in mind.
Now back to your questions:
 
Is it possible to add Complex Event Processing / Event Stream Processing capabilities?
 
Zyan allows publishing events from your server components and handling events on clients.
It's up to you to handle incoming events in any possible way, but Zyan won't provide you any specific help concerning the so-called CEP application model.
 
Perhaps this can be done through Rx
 
Zyan works with RX as demonstrated in the sample above.
 
Have a look at: http://esper.codehaus.org/, http://www.jboss.org/drools/drools-fusion.html, http://technet.microsoft.com/en-us/library/ee362541.aspx (most closet to .net use case)
 
Zyan doesn't compete with these libraries as they serve different purposes. Here is a quick list:
  • Zyan allows you composing multi-tier distributed applications with transparent support for LINQ and events, while CEP libraries don't.
  • Zyan can host distributed event-based components (EBC) while these libraries don't.
  • Zyan enables RPC interoperation between .NET (Windows), Mono (MacOS/Linux) and Xamarin.Android applications while these libraries don't.
  • CEP libraries provide means for aggregating/analyzing incoming stream of events, while Zyan don't.
In my opinion, Zyan doesn't look like a tool you're searching for.