Monday, July 18, 2011

How to send filtered events from WSO2 Complex Event Processing Server to your mail box

Most important thing in complex event processing is the EVENT. It will be very useful if we can direct the filtered events to the email box of the user which the most frequently accessible thing in busy schedules even with their mobile phones.

If we take a simple example:

There is a person with very busy schedule , who used to place trades in Stock market with his mobile phone. But he has to keep his eye open on the stock prices in order to place a profitable order. With this WSO2 Complex Event Processing Server , we can make his life easy. What he has to do is, Configure the WSO2 Complex Event Processing Server to receive events stream from stock market and filter the events which will be worth to trade and send an e mail to the inbox of the user. Once the email is received to the inbox, user would get the alert and he will be able to place an order via his mobile phone.

With WSO2 Complex event processing server, it will be very easy for the user to direct filtered events to his/her mail box. There are only two steps.

Step 01 : Add mail transport sender to the axis2_client.xml file.

In order to do this place the following code segment in axis2_client.xml file in the "Transport Outs " section.

<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
<parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
<parameter name="mail.smtp.user">synapse.demo.0</parameter>
<parameter name="mail.smtp.password">mailpassword</parameter>
<parameter name="mail.smtp.host">smtp.gmail.com</parameter>
<parameter name="mail.smtp.port">587</parameter>
<parameter name="mail.smtp.starttls.enable">true</parameter>
<parameter name="mail.smtp.auth">true</parameter>
</transportSender>

Save the file and start the server.

Step 02:

Create the bucket in WSO2 Complex Event Processing server. You can find more information on
that here.

Create the output topic through the "Topics" menu of WSO2 Complex Event Processing Server and create a subscription by providing event sink URL as : "mailto:test@test.com". User can provide his email address here. Once this is done, user will get an email on any filtered event from his
CEP bucket.

Tuesday, June 21, 2011

Flash vedios ubuntu not available in /tmp - new location - Browser cache

Users have used to get the hard copies of online vedios from various flash using sites from /tmp directory. But with the latest versions of ubuntu it no longer works.

Users can still find .flv files of viewed videos on their hard-drive but now located in the cache folder for the respective browser used to view them. These are most commonly located in your home folder, for example:

.mozilla/firefox/userprofile/Cache

Monday, February 7, 2011

WSO2 Complex Event Processing Server 1.0.0- Alpha Released...

WSO2 Complex Event Processing Server Development team has released the Alpha version of WSO2 Complex Event Processing Server early January 2011.

What is WSO2 Complex Event Processing Server ?

WSO2 Complex Event Processing server acts same as other CEP Servers on processing events and generating new events on analyzing incoming events from multiple sources.




As you can see in the above diagram , Any Complex Event Processing Server can receive any number of events from any number of event sources. What the CEP Server does is analyzing the content of the receiving event and identify the meaningful events from the receiving event cloud. When multiple events matches with a query specified by a user of the server, it creates a new event indicating the satisfied conditions.


How WSO2 CEP Server is different from others ?


WSO2 Complex Event Processing server introduce Complex Event Processing to SOA World. We have complex event processing servers in standalone mode. Here WSO2 is providing the users to use Complex Event Processing Engines as Web Services. So any user is not needed to have there own server running on their premises to use Complex Event Processing feature on the events received. What he need to do is access a web service providing Complex Event Processing Service by WSO2 Complex Event Processing Server.

What is the Event Processing Engine Running in WSO2 CEP ?


WSO2 Complex Event Processing Server is Running of Drools Fusion Complex Event Processing Engine and it is embedded to the server. Apart from that it is very easy for the user to add the Esper complex Event Processing Engine to WSO2 CEP Server. It is a matter of installing the Esper Feature on WSO2 CEP Server.

What is the basic concept used in WSO2 CEP Server?


In WSO2 CEP Server is developed by WSO2 CEP Development team with the Concept of 'Bucket' to be used in the entire server. Actually a Bucket is an instance of a Complex Event Processing Server.
So when a particular user creates a bucket means, he creates a separate instance of a CEP Engine for him.


Here is the Concept in WSO2 CEP Server..




Can I play with this release?

Yes of course, What you need to do is download the binary distribution of the WSO2 CEP Server and start the server.You can find the binary distribution and the documentation in the following location :

WSO2 Complex Event Processing Server 1.0.0-Alpha

You can find the installation guide for the WSO2 CEP Server in the following location :

WSO2 CEP Installation Guide

What do i have to know to deal with this?

You are not needed to have a huge knowledge on Complex Event Processing to deal with this WSO2 CEP Server. All the basic things used in this server has clearly explained in the User Guide of the documentation of this server.

WSO2 CEP Documentation

It will be an added advantage if you have knowledge on Complex Event Processing and Writing queries with ESPER , and DROOLS Fusion Complex Event Processing Engines.

You can get a broad idea on WSO2 via http://wso2.org/

Thursday, December 23, 2010

Complex Event Processing (CEP)

Complex Event Processing
------------------------
It is essential to have a clear idea about ' Event' before proceeding to Complex Event Processing.

What is an Event ?

"An event may be observed as a change of state with any physical or logical or otherwise discriminated condition of and in a technical or economical system, each state information with an attached time stamp defining the order of occurrence and a topology mark defining the location of occurrence"

What is Complex Event Processing ?


"Complex Event Processing, or CEP, is basically an event processing concept that can be used in identifying the most meaningful events within the event cloud, analyzing their impact, and taking subsequent action in real time. Complex event processing refers to process states, the changes of state exceeding a defined threshold of level, time, or value increment or just of a count as the event. It requires the respective event monitoring, event reporting, event recording and event filtering. "

According to the Complex Event Processing (http://complexevents.com/?page_id=3) website, by Research Professor David Luckham:

“Complex Event Processing (CEP) is an emerging technology for building and managing information systems including:

* Business Activity Monitoring
* Business Process Management
* Enterprise Application Integration
* Event-Driven Architectures
* Network and business level Security
* Real time conformance to regulations and policies.”

What is expected from a CEP Engine ?

There can be found three most common things expected from a CEP engine by most of above applications.

1. High throughput - process large volumes of messages (between 1,000 to 100k messages per second)


2. Low latency - React in real-time to conditions that occur (from a few milliseconds to a few seconds)


3. Complex computations - Detect patterns among events (event correlation), filter events, aggregate time or length windows of events, join event streams, trigger based on absence of events etc.



What are available complex event processing engines ?

It can be found many complex event processing engines and most of them are developed to address the requirements of above mentioned applications which analyze and reacts to events.
Some of them are :

Drools Fusion Complex Event Processing Engine (http://www.jboss.org/drools/drools-fusion.html)
Esper Fusion Complex Event Processing Engine (http://esper.codehaus.org/)
Yahoo Complex Event Processing Engine (http://www.infoq.com/news/2010/11/yahoo-releases-s4)



Example:
Lets consider the weather department of a particular area. It has so many sensors which are generating event streams. But as all of us know that each and every
event generated by these sensors are not useful. Therefor it is needed to filter out useful events from these event streams.

Lets say the weather department has three sensor types to detect
* Speed of the wind
* Humidity
* Light intensity

When it is processing the events generated with these sensors, There may be a time :

* Speed of wind value hits a threshold value of raining condition
* Humidity value hits a threshold value of raining condition
* Light intensity value hits a threshold value of raining condition

When the above three conditions occurs simultaneously , It can be a new event generated on 'Rain within next hour'.

Wednesday, October 13, 2010

Business Rules

What are business rules? Where we use them ?

Business Rule is a some kind of a rule that relates to a particular business. From time to time this rules may change. We know there is a logic behind each and every decision we get. Normaly we are getting some decision by considering some facts. Same thing apply to business. In business we get some decision , after considering some kind of facts. These facts may change from time to time according to the nature of the business.

Lets take a simple example : A Mobile Service Provider

With the experience we know , Mobile Service Providers most interested party is their customers. So they do many kind of promotions to attract customers to them. So from time to time they change their call rates and freely available features , etc. Here What they are doing is changing the logic from time to time according to their requirement. But they do not change the way they operate.

Basically we can separate this in to two parts;
1. What is to be done (Logic)
2. How is to be done (Implementation)

So in our example, from time to time , Business development team of the Mobile Service provide change the logic. We know Mobile Service Providers are running there business with some kind of a software. So software is developed by developers when the logic is clearly identified. Lets take a simple example:

if the season is new year festival season , all the call rates must be reduced by 10%

So this is the logic that software should perform actions behind. This logic may change from time to time. So if we are going to implement software using if else statements, We have to implement it each and every time logic changes. In Software world, This is a mess. So we need to have a solution to this problem, which we can change the logic with out changing the software.

This is the point Business Rules comes in to play.

With the use of business rules we can change the logic, with out affecting to the implemented software. There are many kind of rule engines. JBOSS Drools is the most common language we can use to write these business rules.

Since business rules are decide by business management people, business rules should be easy to understand by a person who have very little knowledge in java, c++ or what ever. Drools provide this simplicity.

you can get clear idea on drools by refering to the JBOSS Drools web site

Tuesday, October 12, 2010

Java Messaging Service (JMS)

What is Java Message Service ?
Before jumping in to the JMS directly , it is worth to get a back ground knowledge on where we use JMS. Lets get a bit understanding on messaging system.
We know people use email to communicate with each other. When we send an email to an address of another person , we are pretty sure that , the message will be delivered to that person , since all the stuff handled by email system. So email is commonly used human to human messaging system.

Here we basically consider about how different software applications can communicate with each other using messaging systems. In many business systems, it can be found application - to - application messaging systems and they are generally identified as Enterprise Messaging Systems or Message Oriented Middleware. (MOM)
Message-Oriented Middleware, can be used to transmit messages from one application to another across a network. These Enterprise Messaging Systems ensure that messages are properly distributed among applications. Apart from that Enterprise Messaging Systems provide ;
  • Fault tolerance
  • Load balancing
  • Scalability
  • Transactional support



How to create a patch file and how to apply that to the source code

Here i m going to tell you how we can easily create a patch file and how we can apply that patch file in to our source code;

Creating the patch file:

To create a patch file you need to have SVN access. When you want to create a patch file
move to the location that you have a difference with svn . Then use the bellow command to create the patch file.

svn diff > patchFileToBeCreated.txt

this will create the patch file called "patchFileToBeCreated.txt" in the same location.

Then when any other person wants to apply your patch to his source , he should have the same SVN revision that you created your patch file.

to apply the created patch file , you have to go to the same folder path that you created your patch file
Then use the bellow command to apply the patch to your source

patch -p0 < patchFileToBeCreated.txt