tag:blogger.com,1999:blog-77930694116855676852024-03-22T03:55:44.720-07:00Suhorish !Suho's style, tech tips and thoughts ...Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.comBlogger56125tag:blogger.com,1999:blog-7793069411685567685.post-2780389287412431112016-11-07T12:49:00.002-08:002016-11-08T05:59:00.205-08:00Setting up Hadoop to run on Single Node in Ubuntu 15.04<div dir="ltr" style="text-align: left;" trbidi="on">
This is tested on hadoop-2.7.3.<br />
<br />
Improvement on Hadoop documentation : <a href="http://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-common/SingleCluster.html">http://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-common/SingleCluster.html</a><br />
<br />
<span style="font-size: large;">Step 1 </span><br />
<span style="font-size: large;"><br /></span> Make sure Java is installed<br />
<br />
Installation instruction : <a href="http://suhothayan.blogspot.com/2010/02/how-to-set-javahome-in-ubuntu.html">http://suhothayan.blogspot.com/2010/02/how-to-set-javahome-in-ubuntu.html</a><br />
<br />
<span style="font-size: large;">Step 2</span><br />
<span style="font-size: large;"><br /></span> Install pre-requisites<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ sudo apt-get install ssh</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">$ sudo apt-get install rsync</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span> <span style="font-size: large;">Step 3</span><br />
<span style="font-size: large;"><br /></span> <span style="font-family: "times" , "times new roman" , serif;">Setup Hadoop</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span> <span style="font-family: "courier new" , "courier" , monospace;">$ gedit hadoop-2.7.3/etc/hadoop/core-site.xml</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span> <span style="font-family: "times" , "times new roman" , serif;">Add (replace </span><span style="font-family: "courier new" , "courier" , monospace;">{user-name}</span><span style="font-family: "times" , "times new roman" , serif;"> with system username, E.g "foo" for </span><span style="font-family: "courier new" , "courier" , monospace;">/home/foo/</span><span style="font-family: "times" , "times new roman" , serif;">)</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span> <span style="font-family: "courier new" , "courier" , monospace;"><configuration></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> <property></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> <name>fs.defaultFS</name></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> <value>hdfs://localhost:9000</value></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> </property></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> <property></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span><name>hadoop.proxyuser.<b>{user-name}</b>.groups</name></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> <value>*</value></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> </property></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> <property></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> <name>hadoop.proxyuser.<b>{user-name}</b>.hosts</name></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> <value>*</value></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> </property></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"></configuration></span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ gedit hadoop-2.7.3/etc/hadoop/</span><span style="font-family: "courier new" , "courier" , monospace;">hdfs-site.xml </span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span> <span style="font-family: "times" , "times new roman" , serif;">Add </span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span> <span style="font-family: "courier new" , "courier" , monospace;"><configuration></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> <property></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> <name>dfs.replication</name></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> <value>1</value></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> </property></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"></configuration></span><br />
<br />
<span style="font-size: large;">Step 4</span><br />
<span style="font-size: large;"><br /></span> Run<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ ssh localhost </span><br />
<br />
<span style="font-family: "times" , "times new roman" , serif;">If it requested for password, run:</span><br />
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;">$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa</span></div>
<div style="text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;">$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys</span></div>
<div style="text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;">$ chmod 0600 ~/.ssh/authorized_keys</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif;">Try</span><span style="font-family: "courier new" , "courier" , monospace;"> ssh localhost </span><span style="font-family: "times" , "times new roman" , serif;">again.</span><br />
<span style="font-family: "times" , "times new roman" , serif;">If it still asks for password, run following and try again:</span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ ssh-keygen -t rsa</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">#Press enter for each line</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">$ chmod og-wx ~/.ssh/authorized_keys </span></div>
<div style="text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-size: large;">Step 5</span></div>
<div style="text-align: left;">
<span style="font-family: "times" , "times new roman" , serif; font-size: large;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: "times" , "times new roman" , serif;">Clean namenode</span></div>
<div style="text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;">$ ./</span><span style="font-family: "courier new" , "courier" , monospace;">hadoop-2.7.3/</span><span style="font-family: "courier new" , "courier" , monospace;">bin/hdfs namenode -format</span></div>
<div style="text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-size: large;">Step 6 <b>* Not provided in Hadoop Documentation</b> </span></div>
<div style="text-align: left;">
<span style="font-size: large;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: "times" , "times new roman" , serif;">Replace ${JAVA_HOME} with hardcoded path in hadoop-env.sh</span></div>
<div style="text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;">$ </span><span style="font-family: "courier new" , "courier" , monospace;">gedit </span><span style="font-family: "courier new" , "courier" , monospace;">hadoop-2.7.3/</span><span style="font-family: "courier new" , "courier" , monospace;">etc/hadoop/hadoop-env.sh</span></div>
<div style="text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: "times" , "times new roman" , serif;">Edit the file as </span></div>
<div style="text-align: left;">
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<span style="font-family: "courier new" , "courier" , monospace;"># The java implementation to use.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">export JAVA_HOME=<b>{path}</b>/jdk1.8.0_111</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span> <span style="font-size: large;">Step 7</span><br />
<span style="font-size: large;"><br /></span> <span style="font-family: "times" , "times new roman" , serif;">Start Hadoop </span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span> <span style="font-family: "courier new" , "courier" , monospace;">$ ./hadoop-2.7.3/sbin/start-all.sh</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span> <span style="font-family: "times" , "times new roman" , serif;">The Hadoop daemon log output is written to the $HADOOP_LOG_DIR directory (defaults to $HADOOP_HOME/logs).</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span> <span style="font-family: "times" , "times new roman" , serif;">Browse the web interface for the NameNode;</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span> <span style="font-family: "courier new" , "courier" , monospace;">http://localhost:50070/</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span> <span style="font-size: large;">Step 8</span><br />
<span style="font-size: large;"><br /></span> <span style="font-family: "times" , "times new roman" , serif;">Check processors running by running:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span> <span style="font-family: "courier new" , "courier" , monospace;">$ jps</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span> <span style="font-family: "times" , "times new roman" , serif;">Output: </span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span> <span style="font-family: "courier new" , "courier" , monospace;">xxxxx NameNode</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">xxxxx</span><span style="font-family: "courier new" , "courier" , monospace;"> ResourceManager</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">xxxxx</span><span style="font-family: "courier new" , "courier" , monospace;"> DataNode</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">xxxxx</span><span style="font-family: "courier new" , "courier" , monospace;"> NodeManager</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">xxxxx</span><span style="font-family: "courier new" , "courier" , monospace;"> SecondaryNameNode</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span> <span style="font-size: large;">Step 9</span><br />
<br />
Make HDFS directories for MapReduce jobs:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">$ ./hadoop-2.7.3/bin/hdfs dfs -mkdir /user</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">$ ./hadoop-2.7.3/bin/hdfs dfs -mkdir /user/<b>{user-name}</b></span><br />
<br />
<br /></div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com56tag:blogger.com,1999:blog-7793069411685567685.post-5887897279578510342016-03-12T19:36:00.001-08:002016-03-12T19:52:00.305-08:00Sensing the world with Data of Things <div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 1.38; white-space: pre-wrap;">Henry Ford once said “Any customer can have a car painted any colour that he wants </span><span style="line-height: 1.38; white-space: pre-wrap;">so long as it is black!” which it’s now long gone. In the current context people seek for personalized treatment. Imagine calling customer service, every time you call you have to go through all the standard questions, and they don’t have a clue why you might be calling? Or whether you called before? and in the case of shopping, even if you are a regular customer and have a platinum or gold membership card you will not get any special treatment at the store, may be presenting the card at the cashier can get you a discount. </span></span></div>
<div style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 1.38; white-space: pre-wrap;"><br /></span>
</span></div>
<span style="font-family: Arial, Helvetica, sans-serif; line-height: 1.38; white-space: pre-wrap;">What’s missing here? They don’t know anything about the customer to give a better service. Hence the simple remedy for the above issue is building customer profiles, this can be done with the historical data you might have about the customer, next you need to understand and react to the context the customer evolves such as whether he is in an urgency, has he contacted you before, etc, and finally you have to react in real time to give the best customer satisfaction. Therefore to provide the best customer satisfaction identifying the context is a key element, and in the present world the best way of identifying the customer context is via the devices your customer has and via the sensors that’s around him which indeed the Internet of Things (IoT) </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-weight: normal;"><br /></span>
</span></div>
<div style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 1.38;"><span style="color: black; vertical-align: baseline; white-space: pre-wrap;">IoT</span></span><span style="line-height: 1.38;"><span style="color: black; vertical-align: baseline; white-space: pre-wrap;"> is not a new thing, we have had lots of M2M systems that have monitored and controlled devices in the past, and when it comes to IoT we</span></span><span style="color: black; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;"> have more devices having sensors and a single device having more sensors. IoT it’s an ecosystem where IoT devices should be manufactured, app for those devices should be developed (e.g app</span><span style="color: black; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;">s for phone), users </span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: black; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;">should be using those devices and finally they should be monitored and managed. <a href="http://wso2.com/iot" target="_blank">WSO2’s IoT Platform</a> plays a key role in managing and providing an</span><span style="color: black; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;">alytics for th</span><span style="color: black; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;">e IoT devices in the ecosystem. </span></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><a href="http://wso2.com/iot" target="_blank"><img height="416" src="https://lh6.googleusercontent.com/NGBTIaPjl6m2UnhOzNtYTGAa4Q_VZb6t7Of1pVreFj0sqJZDqVy7wg6QS7_98gOzXSh_FOgBokvHVDZdWefxTzYYJLEBCvixs7Zl830mhfVdeZe2z6RoAhpTwmSGygCQO_7zbDBI" style="border: none; transform: rotate(0rad);" width="640" /></a></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Data Types in IoT Analytics </span></h2>
<div>
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Data from IoT devices</span></span><span style="color: black; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;"> are time bound because these devices do continuous monitoring and reporting. With this we can do time series processing such as energy consumption over time. OpenTSDB is a specialised D</span><span style="color: black; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;">B implemented for time based processing. </span></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">F</span></span><span style="line-height: 1.38;"><span style="color: black; vertical-align: baseline; white-space: pre-wrap;">urther since IoT devices are deployed in var</span><span style="color: black; vertical-align: baseline; white-space: pre-wrap;">ious geological locations and since some of those devices move, location is also becomes another important data type for IoT Devices. IoT devices are usually tacked </span></span><span style="line-height: 1.38; white-space: pre-wrap;">with GPS and currently iBeacons are used when the devices are within a building. Location based data enables geospatial processing such as traffic planning and better route suggestion for vehicles. Geospatially optimised processing engines such as GeoTrellis are especially developed for these type of usecases. </span></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">IoT is Distributed </span></h2>
<div>
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Since</span><span style="line-height: 1.38; white-space: pre-wrap;"> IoT is distributed by nature, components of the IoT network constantly get added and removed. Further since IoT devices get connected to the IoT network through all type of communication networks such as from weak 3G networks to Ad-hoc peer-to-peer networks, and they also use various communication protocols such as Message Queuing Telemetry Transport (MQ</span><span style="line-height: 1.38; white-space: pre-wrap;">TT), Common Open Source Publishing Platform (CoApp) and ZigBee or Bluetooth low energy (BLE). Due to these the data flow of the IoT network continuously get modified and repurposed. As data load varies dynamically in the IoT network, on-premise deployment will not be suitable, and hence we have to move towards public or hybrid cloud based deployment. IoT has an event driven architecture to accommodate its distributed nature where its sensors reports data as continuous event streams working in an asynchronous manner. </span></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Analytics for IoT </span></h2>
<div>
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">IoT</span></span><span style="color: black; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;"> usually produces perishable data where their value drastically degrades over time. This imposes the importance of </span><span style="color: black; font-weight: 700; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;">Realtime Analytics</span><span style="color: black; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;"> in IoT. With Realtime Analytics temporal patterns, logical patterns, KPIs and thresholds can be detected and immediately alerted to respective stakeholders, such as alarming when temperature sensor hits a limit and notifying via car dashboard if the tire pressure is low. Systems such as Apache Storm, Google Cloud DataFlow & WSO2 CEP are build for implementing such Realtime Analytics usecases. </span></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
</span><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Realtime alone is not enough! We should be able to understand how current situation deviates from the usual behaviour, to do so we have to process historical data. With </span><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Batch Analytics,</span><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> periodic summarisation and analytics can be performed on historic data against which we can compare at realtime. Average temperature in a room last month, and total power usage of the factory last year are some example summarizations that can be done using systems like Apache Hadoop & Apache Spark on the data stored in scalable databases such as Apache Cassandra and Apache HBase.</span></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Ok, with Batch Analytics we defined the thresholds and with Realtime Analytics we detected and alerted threshold violations. Notifying violations may results in preventing disasters but it does not help stopping similar issues arising again. To do so we need to investigate the historical data and identify the root course of the issue and eliminate that. This can be done through </span><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Interactive Analytics </span><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">and with it’s Ad-Hoc Queries, it enables us to search the data set how system and all related entities have behaved before the alert was raised. Apache Drill, Apache Lucene and indexed storage systems such as Couchbase are some systems provides Interactive Analytics. </span></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Than being reactive, staying a step ahead predicting issues & opportunities bring great value. This can be achieved through </span><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Predictive Analytics</span><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> which helps in scenarios such as proactive maintenance, fraud detection and health warnings. Systems such as Apache Mahout, Apache Spark MLlib, Microsoft Azure Machine Learning, WSO2 ML & Skytree are systems that can help us build Predictive Analytics models. </span></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">An Integrated Solution for IoT Analytics</span></h2>
<div>
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">From the about technologies by selecting WSO2 Siddhi, Apache Storm, Apache Spark, Apache Lucene, Apache HBase, Apache Spark MLLib and with many other open source softwares WSO2 has built and integrated Data Analytics solutions that support Realtime, Batch, Interactive and Predictive analytics solution called <a href="http://wso2.com/analytics" target="_blank">WSO2 Data Analytics Server</a>. </span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><a href="http://wso2.com/analytics" target="_blank"><img height="326" src="https://lh6.googleusercontent.com/lhc9-gocfEuTC8AYv-P3dcAYA9cny5p8YEbaI-qE6mtve9xEkKmRmmHopAKUiT9eY0qXgjNVrMXAYHTze-tSlaaWCWRszrkjrUR7Pb957WIa-JFUCOOAmKNR-3XdxNCfkq7T_XK5" style="border: none; transform: rotate(0rad);" width="640" /></a></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Issues in IoT Analytics </span></h2>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<h3 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Extreme Load </span></h3>
<div>
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">With compared with the scale of the data produced by sensors, distributed centralised analytic platforms cannot scale and even if they can - it will not be cost effective. Hence we should look at whether w</span><span style="color: black; line-height: 1.38; vertical-align: baseline; white-space: pre-wrap;">e need to process and/or store all the data produced by the sensors? In most cases we only need the aggregations over time, trends that exceed thresholds, outliers, event matching a rare condition, and when the system is unstable or changing. For example from a temperature sensor we only need to send readings when there is a change in </span><span style="line-height: 1.38; white-space: pre-wrap;">temperature and its no point periodically sending same value. This directs us to optimise sensors or data collection points to focus on doing local optimisations before publishing data. This helps in quick detection of issues as part of the data is already processed locally and instant notifications since decisions are also taken at edges. Taking decision at the edge can be implemented with the help of complex event processing libraries such as WSO2 Siddhi and Esper. </span></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<h3 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif; font-size: small;"><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Uncertainty</span><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></span></h3>
<div>
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Due to the distributed nature of IoT, data produced can be </span><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">duplicated, arrives out of order, missing or even be wrong</span><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">. </span></span><br />
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Redundant sensors & network latency can introduce duplicated events and out of order event arrival. This can impose difficulty doing temporal event processing, such as Time Windows & Pattern Matching. These are very useful for usecases such as Fraud detection, and Realtime Soccer Analytics (based on DEBS 2013 dataset) </span><a href="https://goo.gl/c2gPrQ" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://goo.gl/c2gPrQ</span></a><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> where we build a system that monitors the soccer players and the ball and identified ball kicks, ball possession, shot on goal & offside. Algorithms based on <a href="https://www2.informatik.uni-erlangen.de/publication/download/IPDPS2013.pdf" target="_blank">K-Slack</a></span><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> can help to order events before processing them on realtime.</span></span><br />
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Due to network outages data produced by the IoT sensors can go missing, and in these situations using complimenting sensor reading are very important where one of those sensor value will be some sort of an aggregation done at the edge which will help us to approximate the missing sensor values based on its aggregation. Such as publishing Load and Work reading when monitoring electricity where when some events are missed, from a later Work Event reading we will be able to approximate the Load reading that should have arrived during the outage. The other alternative is using fault-tolerant data streams such as Google Millwheel. </span><br />
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Further at times sensor reading won't be correct, this can be due to various reasons such as sensor quality and environment noise, in such situations we can use kalman filtering to smoothen consecutive sensor readings for better approximation. These type of issues are quite common when we use iBeacons for location sensing. </span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<h3 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Visualisation of IoT data</span></h3>
<div>
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: transparent; color: black; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Visualisation is one of the most important aspect of effective analytics and hence with Big Data and IoT visualisation becomes even complicated. Per-device & Summarization Views are essential and more than that users should be able to visualize as device groups based on various categorie</span><span style="line-height: 1.38; white-space: pre-wrap;">s such as device type, location, device owner types, deployed zone and many more. Since these categories are dynamic and each person monitoring the system have various personal preferences, therefore composable & customisable dashboard is essential. Further charts and graphs should be able to visualise the huge stored data, where sampling & indexing techniques can be used for better responsiveness. </span></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<h3 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Communicating with devices </span></h3>
<div>
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">In IoT sending a command/alert to a devices is complicated, to do so we have to use client side pooling based techniques. Here we store the data the need to be pushed to the client in a database or queue and expose them via secured APIs (through systems like WSO2 API Manager). </span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<h2 style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Reference Architecture for IoT Analytics</span></h2>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; margin-left: 1em; margin-right: 1em; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="446" src="https://lh5.googleusercontent.com/G8dnlwVksF3JKgUDtFKkkZfcyEVXomS2feM96DFlBibcGK3VSW-yt408ivsFGIhgGi435iFvnnn4sP988qQiCvSuW6_naJmEQL2SfaJ0UHHQAPj2pgNwfSvgS6kCUIjqWFr8YzJv" style="border: none; transform: rotate(0rad);" width="640" /></span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b><span style="line-height: 1.38; white-space: pre-wrap;">Here data is collected through message broker such as MQTT, immediately written to the disk by WSO2 Data Analytics Server (DAS), at the meantime the collected data is cleaned in realtime, this cleaned data is also persisted, and parallely the cleaned data is fed into realtime event processing which in deed sends alerts and provides realtime visualisations. Stored clean data is used by WSO2 Machine Learner (ML) to build machine learning models and deploy them at WSO2 DAS for realtime predict ions. Further the stored clean data is also used by Spark to run Batch analytics producing sumarisation, which are then visualised in dashboards. </span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b style="font-weight: normal;"><br /></b>
</span><br />
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<div style="line-height: 1.38;">
<span style="background-color: transparent; color: black; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">It’s a pleasure for me presenting “Sensing the world with Data of Things” at Structure Data 2016, San Francisco. Please find the slides below. </span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div style="text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif; line-height: 22.08px; white-space: pre-wrap;"><br /></span></div>
<span style="font-family: Arial, Helvetica, sans-serif; line-height: 1.38;"></span><br />
<div style="text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif;"><iframe allowfullscreen="" frameborder="0" height="485" marginheight="0" marginwidth="0" scrolling="no" src="//www.slideshare.net/slideshow/embed_code/key/3mnI6jYJBa6H3T" style="border: 1px solid rgb(204, 204, 204); line-height: 1.38; margin-bottom: 5px; max-width: 100%;" width="595"></iframe></span></div>
<span style="font-family: Arial, Helvetica, sans-serif; line-height: 1.38;">
</span><br />
<div style="line-height: 1.38; margin-bottom: 5px;">
<div style="text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><strong> <a href="https://www.slideshare.net/suho/sensing-the-world-with-data-of-things-59477338" target="_blank" title="Sensing the world with Data of Things">Sensing the world with Data of Things</a> </strong> from <strong><a href="https://www.slideshare.net/suho" target="_blank">Sriskandarajah Suhothayan</a></strong></span> </div>
</div>
</div>
</div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com5tag:blogger.com,1999:blog-7793069411685567685.post-47351900318202517912016-02-28T08:22:00.002-08:002016-02-29T07:05:11.107-08:00WSO2 Complex Event Processor 4.1<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">WSO2 Complex Event Processor 4.1 released 23rd February 2016. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This release mainly focuses on improving and stabilizing the product and enhancing its capabilities. </span></div>
<b id="docs-internal-guid-aada3eed-28aa-cb43-4e9e-6ad2c64b13e3" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">One of the main features that was included in this release is <a href="https://docs.wso2.com/display/CEP410/Using+Event+Metrics">instrumenting and monitoring</a> support for WSO2CEP as well as Siddhi. This enable users to identify throughput and memory consumption of each and every component of WSO2CEP and Siddhi. Through this users can identify possible bottlenecks in their queries and optimize CEP for better performance.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="525" src="https://lh4.googleusercontent.com/-LW_t3FC1TYH5CzHhcCnetNgO37yUP8EMjQbKLxUpl6coH-Y5_i4t7tiwEbpSxJmVWPGDLeKojHAb9YEJCfc1tMBwlN8_AsNANpwhFoyZQFk1mg1On4YvdRhNNtDodsHR74L--EI" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The same is also exposed via JMX such that It can be monitored to third party JMX consumers such as jconsole.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="351" src="https://lh5.googleusercontent.com/duE0XBZ29p1yNGivfez6SqcJwNXKyvw72iF9GwUEShmaeCrscLwofmMeuxazpfJwBP2ImpKOut61DTUJvdhDi5lFCW8w9bjlBn8T_MrswpQ4ImPaSPkAgZs_lZe9P5FZKtodYpw1" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Another important feature CEP introduced in this release is visualizing Siddhi queries.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "arial"; font-size: 14.6667px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="405" src="https://lh5.googleusercontent.com/lChjVTbZ3MbQGLihWao0ah4xMcm5jUX-dEB-1p1SmvYmNCJD3aOJUybpb_hDO-8NhsqJbryYCxyNok0LpiTDV9gYdfpi_fcTmQgNi2K_SHbkvG-L7ChavYdUtumBicZrJ4umULJL" style="border: none; transform: rotate(0rad);" width="624" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">One of the notable improvement of this release is its improved high-availability support. now CEP can support high availability with more than two nodes providing zero downtime with no data loss, and as it also stores its state as a periodic snapshot to a database even during full cluster restart CEP has the capability of restoring it state from its last available snapshot. For more information refer the documentation <a href="https://docs.wso2.com/display/CLUSTER44x/Clustering+CEP+4.1.0#ClusteringCEP4.1.0-Highavailabilitydeployment">here</a>. </span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Further WSO2CEP has introduced several improvements to it’s core runtime complex event processor engine Siddhi. They are as follows:</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: "arial"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Hazelcast Event Table - Allowing events to be stored and manipulated in Hazelcast based In-Memory Data Grid. </span></div>
</li>
<li dir="ltr" style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: "arial"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Minima and Maxima detection - Detecting maxima and minima in an event pattern, this allows detecting complex stock market patterns using combinations of maxima and minima.</span></div>
</li>
<li dir="ltr" style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: "arial"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Map extension - This is introduced to support arbitrary key value pairs in Siddhi which was not supported for a long time. This function allows users to create a map, add remove and check for keys and values within a hash map. </span></div>
</li>
<li dir="ltr" style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: "arial"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">InsertOrUpdate to Event Table - This facilitate doing and insert or an update as an atomic operation on Even Tables. </span></div>
</li>
<li dir="ltr" style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: "arial"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Outer and left joins in Siddhi - In addition to inner joins Siddhi now supports outer and left joins </span></div>
</li>
<li dir="ltr" style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: "arial"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Time length window - The eviction policy on Siddhi window is triggered both by time and length properties.</span></div>
</li>
<li dir="ltr" style="background-color: white; color: #333333; font-family: Arial; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: "arial"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">External Batch window - Allowing batch window to get triggered by event time rather by getting triggered by the system time. </span></div>
</li>
</ul>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #333333; font-family: "arial"; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">You can download WSO2 Complex Event processor 4.1 from <a href="http://wso2.com/products/complex-event-processor/">here</a>, its documentation from <a href="https://docs.wso2.com/display/CEP410">here</a>, and find the latest Siddhi documentation <a href="https://docs.wso2.com/display/CEP410/SiddhiQL+Guide+3.0">here</a>. </span></div>
</div>
Anonymousnoreply@blogger.com4tag:blogger.com,1999:blog-7793069411685567685.post-3599192015537934762016-01-11T11:00:00.000-08:002016-01-11T11:00:36.786-08:00Adding Statistics to Siddhi 3<div dir="ltr" style="text-align: left;" trbidi="on">
A new statistics feature is added to Siddhi 3.0.5.<br />
<br />
This will help users to find how their queries are behaving and to understand what query to optimise to get better performance and to optimise memory consumption.<br />
<br />
This is very easy to enable and you can enable this by just adding<br />
<br />
"<span style="background-color: white; color: #183691; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.8px; white-space: pre;">@plan:statistics(reporter = 'console', interval = '5' )</span>"<br />
<br />
to the execution plan will start statistics reporting on console every 5 seconds.<br />
<br />
You will be able to and output something like<br />
<pre class="prettyprint">1/12/16 12:01:39 AM ============================================================
-- Gauges ----------------------------------------------------------------------
org.wso2.siddhi.executionplan.5910c3f3-1af3-43bd-ae6e-06b1a959eaf3.query1.memory
value = 548804
org.wso2.siddhi.executionplan.5910c3f3-1af3-43bd-ae6e-06b1a959eaf3.query2.memory
value = 556686
-- Meters ----------------------------------------------------------------------
org.wso2.siddhi.stream.cseEventStream.throughput
count = 2
mean rate = 0.37 events/second
1-minute rate = 0.40 events/second
5-minute rate = 0.40 events/second
15-minute rate = 0.40 events/second
org.wso2.siddhi.stream.cseEventStream2.throughput
count = 0
mean rate = 0.00 events/second
1-minute rate = 0.00 events/second
5-minute rate = 0.00 events/second
15-minute rate = 0.00 events/second
org.wso2.siddhi.stream.outputStream.throughput
count = 3
mean rate = 0.57 events/second
1-minute rate = 0.60 events/second
5-minute rate = 0.60 events/second
15-minute rate = 0.60 events/second
-- Timers ----------------------------------------------------------------------
org.wso2.siddhi.executionplan.5910c3f3-1af3-43bd-ae6e-06b1a959eaf3.query1.latency
count = 2
mean rate = 0.38 calls/second
1-minute rate = 0.40 calls/second
5-minute rate = 0.40 calls/second
15-minute rate = 0.40 calls/second
min = 0.01 milliseconds
max = 0.08 milliseconds
mean = 0.05 milliseconds
stddev = 0.04 milliseconds
median = 0.08 milliseconds
75% <= 0.08 milliseconds
95% <= 0.08 milliseconds
98% <= 0.08 milliseconds
99% <= 0.08 milliseconds
99.9% <= 0.08 milliseconds
org.wso2.siddhi.executionplan.5910c3f3-1af3-43bd-ae6e-06b1a959eaf3.query2.latency
count = 2
mean rate = 0.38 calls/second
1-minute rate = 0.40 calls/second
5-minute rate = 0.40 calls/second
15-minute rate = 0.40 calls/second
min = 0.01 milliseconds
max = 0.01 milliseconds
mean = 0.01 milliseconds
stddev = 0.00 milliseconds
median = 0.01 milliseconds
75% <= 0.01 milliseconds
95% <= 0.01 milliseconds
98% <= 0.01 milliseconds
99% <= 0.01 milliseconds
99.9% <= 0.01 milliseconds
</pre>
<pre class="prettyprint"></pre>
You can also add <br />
<br />
"<span style="background-color: white; color: #183691; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.8px; white-space: pre;">@plan:statistics(reporter = 'jmx')</span>"<br />
<br />
to report stats via jmx.<br />
<br />
You can find a sample implementations here.<br />
https://github.com/wso2/siddhi/blob/master/modules/siddhi-core/src/test/java/org/wso2/siddhi/core/managment/StatisticsTestCase.java<br />
<br />
Siddhi also allows users to add custom reporting tools. To do so.<br />
Just implement the StatisticsTrackerFactory interface<br />
<br />
<pre class="prettyprint">package org.wso2.siddhi.core.util.statistics;
import org.wso2.siddhi.query.api.annotation.Element;
import java.util.List;
public interface StatisticsTrackerFactory {
LatencyTracker createLatencyTracker(String name, StatisticsManager statisticsManager);
ThroughputTracker createThroughputTracker(String name, StatisticsManager statisticsManager);
MemoryUsageTracker createMemoryUsageTracker(StatisticsManager statisticsManager);
StatisticsManager createStatisticsManager(List<Element> elements);
}
</pre>
<br />
And add that to the Siddhi Manager<br />
<pre class="prettyprint">siddhiManager.setStatisticsConfiguration(new StatisticsConfiguration(new MyMetricsFactory()));</pre>
<pre class="prettyprint"></pre>
<pre class="prettyprint"></pre>
<br />
<br />
Happy Coding :) </div>
Anonymousnoreply@blogger.com19tag:blogger.com,1999:blog-7793069411685567685.post-81811638807054203242015-09-30T05:32:00.002-07:002015-09-30T05:33:23.432-07:00What to expect in WSO2 CEP 4.0<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://wso2.com/products/complex-event-processor/">WSO2 Complex Event Processor 4.0</a> is released! A long waited CEP release from WSO2. This is a major break through among current CEP products. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-Qi66Dl7K2sw/VgvPRcHBQpI/AAAAAAAAHwo/gBVO1YF0jI4/s1600/cep-logo-h42.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="37" src="http://1.bp.blogspot.com/-Qi66Dl7K2sw/VgvPRcHBQpI/AAAAAAAAHwo/gBVO1YF0jI4/s320/cep-logo-h42.png" width="320" /></a></div>
<br />
Here are some notable features it has introduced :<br />
<br />
<b>Scale and Performance </b><br />
<br />
<ol style="text-align: left;">
<li><b>Support for <a href="https://docs.wso2.com/display/CLUSTER44x/Clustering+CEP+4.0.0#ClusteringCEP4.0.0-DistributedmodedeploymentDistributedCEP">distributed processing</a> with <a href="https://storm.apache.org/">Apache Storm</a></b> - WSO2 CEP runs Siddhi CEP on Apache Storm in a distributed mode while providing an SQL like Siddhi Query Language to <a href="https://docs.wso2.com/display/CEP400/Creating+a+Storm+Based+Distributed+Execution+Plan">define queries on Storm</a>. </li>
<li><b>Faster CEP engine with <a href="https://github.com/wso2/siddhi">WSO2 Siddhi 3.0</a></b> - With LMAX Disruptor and improved memory management, Siddhi was able to run even faster than its predecessors doing ~ 4M Events/Sec</li>
<li><a href="https://docs.wso2.com/display/CLUSTER44x/Clustering+CEP+4.0.0#ClusteringCEP4.0.0-Highavailabilitydeployment"><b>HA Support</b></a> - Supporting Hot-Worm High Availability with zero downtime</li>
<li><b>More effective native thrift/binary transports</b> </li>
</ol>
<div>
<b>Usability</b> </div>
<ol style="text-align: left;">
<li><b><a href="https://docs.wso2.com/display/CEP400/Visualizing+Results+in+the+Analytics+Dashboard">Realtime Dashboard</a> support </b>- Support for gadget generation wizard and customisable realtime dashboard</li>
<li><b>Easy to use <a href="https://docs.wso2.com/display/CEP400/Creating+Execution+Templates">management console</a> for business users</b> - Ability to tweak queries with a form based UI without knowing the implementation and complexities of SiddhiQL, Storm and Java </li>
<li><b><a href="https://docs.wso2.com/display/CEP400/Publishing+Data+Using+Event+Simulation">Event simulation</a> capability</b> - Try sending events easily </li>
<li><b>Siddhi query <a href="https://docs.wso2.com/display/CEP400/Siddhi+Try+It+Tool">try-it</a></b> - Try writing queries </li>
<li><b><a href="https://docs.wso2.com/display/CEP400/Understanding+Event+Streams#UnderstandingEventStreams-EventFlowEventFlow">Event flow</a> visualisation</b> - See how you the event flow pipeline will look like</li>
</ol>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-Oxy2bPbA25c/VgvPZFNMnMI/AAAAAAAAHww/y0aunh1-nQk/s1600/Screenshot%2B2015-09-28%2B22.17.53.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="http://2.bp.blogspot.com/-Oxy2bPbA25c/VgvPZFNMnMI/AAAAAAAAHww/y0aunh1-nQk/s640/Screenshot%2B2015-09-28%2B22.17.53.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<b>Enhancements</b> </div>
<ol style="text-align: left;">
<li><b>New protocols introduced such as <a href="https://docs.wso2.com/display/CEP400/Configuring+CEP+to+Create+Alerts#ConfiguringCEPtoCreateAlerts-EventpublishertypesEventPublisherTypes">MQTT, Kafka, Websocket</a></b> - Support for many new and improved event receiver and publisher capabilities</li>
<li><b>Enhanced query language with more extensions</b> - Such as <a href="https://docs.wso2.com/display/CEP400/SiddhiQL+Guide+3.0#SiddhiQLGuide3.0-ExtensionTypes">Function, Stream Processor, Window and Aggregate Function Processor</a></li>
<li><b>Support for machine learning via <a href="https://docs.wso2.com/display/CEP400/Siddhi+Extensions#SiddhiExtensions-ml">ml</a>, <a href="https://docs.wso2.com/display/CEP400/Siddhi+Extensions#SiddhiExtensions-pmmlpmml">pmml</a> (Predictive Model Markup Language) extensions</b> - To run machine learning model on realtime</li>
<li><b>Support for Natural Language processing via <a href="https://docs.wso2.com/display/CEP400/Siddhi+Extensions#SiddhiExtensions-nlp">nlp</a> (Natural Language Processing) extension</b> - Supported via Stanford NLP</li>
<li><b>Geo processing capabilities via <a href="https://docs.wso2.com/display/CEP400/Siddhi+Extensions#SiddhiExtensions-geo">geo</a> extension and <a href="https://docs.wso2.com/display/CEP400/Geo+Dashboard">Geo Dashboard</a></b> - Dashboard having the capability to monitor and apply queries on geo spaces. </li>
<li><b>Support for scripting using JavaScript, Scala and R</b> - Can use scripts to write CEP logic!</li>
</ol>
<div>
This release not only overcomes the scaling bottleneck of previous WSO2 CEP versions, but it also provides a seamless query language that allows uses to run the same queries both on single node and on distributed environment, making WSO2 CEP 4.0 as a unique product in the market. </div>
<div>
<br /></div>
<div>
<b>You can download WSO2 CEP 4.0 from <a href="http://wso2.com/products/complex-event-processor/">here</a> </b></div>
<div>
<b>and a quick getting started guide can be found <a href="https://docs.wso2.com/display/CEP400/Quick+Start+Guide">here</a> </b></div>
<div>
<br /></div>
<div>
Try it out, and for questions please post on <a href="http://stackoverflow.com/questions/tagged/wso2cep">StackOverflow with tag 'wso2cep'</a>. The community and the WSO2 team will be very happy to answer :)</div>
<div>
<br /></div>
<div>
You can contribute your code e.g. extensions and adopters, such that it will be maintained and released on future product releases:</div>
<div>
For Extensions and Siddhi improvements please send the pull request to <a href="https://github.com/wso2/siddhi">Siddhi repo</a> and </div>
<div>
For adopters and other contributions please send to <a href="https://github.com/wso2/carbon-analytics-common">carbon-analytics-common</a> <a href="https://github.com/wso2/carbon-event-processing">carbon-event-processing</a> and <a href="https://github.com/wso2/product-cep">product-cep</a> repos :) </div>
<div>
<br /></div>
<div>
Be Realtime !!</div>
</div>
Anonymousnoreply@blogger.com3tag:blogger.com,1999:blog-7793069411685567685.post-69234465604837058572015-03-29T11:35:00.001-07:002015-03-29T11:36:03.119-07:00Make it fast for everyone<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<br /></div>
<div>
I spoked at SLASSCOM Tech talk 2015 on performance. I have attached the slides below. This mainly covers how we need to think in terms of performance from product design, choosing technologies and upto testing. Here I have taken examples form middleware products. </div>
<div>
<br /></div>
<div>
The topic "Make it fast for everyone" simply means that when you implement a solution that can be used by many other solutions and then when you make your solution faster and better performing then you are basically making all the dependent components to do their task faster. </div>
<div>
<br /></div>
<div>
<div style="text-align: center;">
<br /></div>
</div>
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="355" marginheight="0" marginwidth="0" scrolling="no" src="//www.slideshare.net/slideshow/embed_code/46421161" style="border-width: 1px; border: 1px solid #CCC; margin-bottom: 5px; max-width: 100%;" width="425"> </iframe> </div>
<div style="margin-bottom: 5px;">
<div style="text-align: center;">
<strong> <a href="https://www.slideshare.net/suho/make-it-fast-for-everyone-performance-and-middleware-design" target="_blank" title="Make it fast for everyone - performance and middleware design">Make it fast for everyone - performance and middleware design</a> </strong> from <strong><a href="https://www.slideshare.net/suho" target="_blank">Sriskandarajah Suhothayan</a></strong> </div>
</div>
<div>
<div style="text-align: center;">
<br /></div>
</div>
<div>
<div style="text-align: center;">
<br /></div>
</div>
</div>
Anonymousnoreply@blogger.com3tag:blogger.com,1999:blog-7793069411685567685.post-24340133925687732102015-03-15T09:56:00.000-07:002015-03-15T09:56:54.012-07:00Becoming a Master in Apache Maven 3<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Writing programs in Java is cool, its a language thats very powerful which have right amount of flexibility that makes a developers life a hell easy. But when it comes to compiling, building and managing releases of a project its not that easy, it also has the same issues encountered by other programming languages.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://dl.dropboxusercontent.com/u/17922825/blog/maven/apache_maven.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: justify;"><img border="0" height="108" src="https://dl.dropboxusercontent.com/u/17922825/blog/maven/apache_maven.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div style="text-align: justify;">
To solve this problem, build tools like <a href="http://ant.apache.org/" target="_blank">Apache ANT</a> and <a href="http://maven.apache.org/" target="_blank">Apache Maven</a> have emerged. ANT is very flexible tool which allows users to do almost any thing when it comes to build, maintenance and releases. Having said that since its so flexible its quite hard to configure and manage, every project using ANT uses it in their own way and hence the projects using ANT looses their consistency. At the same time when we look at Apache Maven which is not flexible as ANT by default, but it follows an amazing concept "Convention over configuration" which give that right mix of convention and configuration for you to easily create, build, deploy and even manage releases at an enterprise level.</div>
<br />
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
For examples Maven always works with defaults, and you can easily create and build a maven project just with the follow snippet in the pom.xml file of your project.</div>
<div style="text-align: justify;">
<br /></div>
<pre class="brush:xml"><project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>sample-one</artifactId>
<version>1.0.0</version>
</project>
</pre>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
And this little configuration is tied up with many conventions</div>
<div style="text-align: justify;">
<br /></div>
<ul style="text-align: left;">
<li style="text-align: justify;">The Java source code is available at {base-dir}/src/main/java</li>
<li style="text-align: justify;">Test cases are available at {base-dir}/src/test/java</li>
<li style="text-align: justify;">A JAR file type of artifact is produced</li>
<li style="text-align: justify;">Compiled class files are copied into {base-dir}/target/classes</li>
<li style="text-align: justify;">The final artifact is copied into {base-dir}/target</li>
</ul>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
But there are cases where we need to go a step ahead and break the rules with reasons ! And in any case if we need to change the above defaults its just a matter of adding the Maven Build Plugin and the artifact type to the project tag as below.
</div>
<pre class="brush:xml"><project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>sample-one</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<build>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
<outputDirectory>${basedir}/target/classes</outputDirectory>
</build>
</project>
</pre>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://dl.dropboxusercontent.com/u/17922825/blog/maven/maven3book.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: justify;"><img border="0" height="320" src="https://dl.dropboxusercontent.com/u/17922825/blog/maven/maven3book.jpg" width="257" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I came across this great book "<a href="https://www.packtpub.com/application-development/mastering-apache-maven-3" target="_blank">Mastering Apache Maven 3</a>" by <a href="http://wso2.com/about/team/prabath-siriwardena/" target="_blank">Prabath Siriwardena</a> that give you all the bits and pieces from getting started to eventually becoming a master in Maven. From this you will get to know the fundamentals and when to break the conventions with reasons. This helps you to develop and manage large, complex projects with confidence by providing an enterprise level knowledge to manage the whole Maven infrastructure.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
This book covers Maven Configuration from the basics, discussing how to construct and build a Maven project, manage Build Lifecycles, introduce useful functionalities through Maven Plugins and helps you to write your own custom plugins when needed. It also provide steps on building distributable archives using Maven Assemblies which adheres to a user-defined layout and structure, demonstrate the usage of Maven Archetypes for easily construct Maven projects and steps to create new Archetypes to help your developers and customers to quickly start on your project type without any configurations and replicated work. Further it also helps you to host and manage your Maven artifacts in repositories using Maven Repository Management, and most importantly explains you the Best Practices to keep your projects in line with enterprise standards.</div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com3tag:blogger.com,1999:blog-7793069411685567685.post-2898634219197562062014-11-19T17:12:00.002-08:002014-11-19T18:03:17.290-08:00Adding Siddhi extensions when using Siddhi as a Java library <div dir="ltr" style="text-align: left;" trbidi="on">
You can write Siddhi extensions and run them in WSO2 CEP as given : <a href="https://docs.wso2.com/display/CEP310/Writing+Extensions+to+Siddhi">https://docs.wso2.com/display/CEP310/Writing+Extensions+to+Siddhi</a><br />
<br />
But if you are using Siddhi as a Java library then you can add then to <span style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">SiddhiManager</span> as follows<br />
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">
<br class="Apple-interchange-newline" />
List<class> extensionClasses = new ArrayList<class>();</class></class></div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">
extensionClasses.add(org.wso2.<wbr></wbr>siddhi.core.query.processor.<wbr></wbr>window.<wbr></wbr>UniqueWindowProcessorExt.<wbr></wbr>class);</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">
</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">
SiddhiConfiguration siddhiConfiguration = new SiddhiConfiguration();</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">
siddhiConfiguration.<wbr></wbr>setSiddhiExtensions(<wbr></wbr>extensionClasses);</div>
<div style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">
</div>
<span style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;"> SiddhiManager siddhiManager = new SiddhiManager(</span><wbr style="color: #222222; font-family: arial, sans-serif; font-size: 13px;"></wbr><span style="background-color: white; color: #222222; font-family: arial, sans-serif; font-size: 13px;">siddhiConfiguration); </span> </div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com9tag:blogger.com,1999:blog-7793069411685567685.post-48268276128408333672014-07-25T00:45:00.001-07:002014-07-25T00:50:35.049-07:00Without restart: Enabling WSO2 ESB as a JMS Consumer of WSO2 MB <div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://wso2.com/products/enterprise-service-bus/" target="_blank">WSO2 ESB</a> 4.8.1 & <a href="http://wso2.com/products/message-broker/" target="_blank">WSO2 MB</a> 2.2.0 documentations have information on how to configure WSO2 ESB as a JMS Consumer of WSO2 MB queues and topics. But they do not point out a way to do this without restarting ESB server.<br />
<br />
In this blog post we'll solve this issue. <br />
<br />
With this method we will be able to create new queues in WSO2 MB and consume them from WSO2 ESB without restarting it.<br />
<h4 style="text-align: left;">
Configure the WSO2 Message Broker </h4>
<ul style="text-align: left;">
<li><a href="https://docs.wso2.com/display/MB220/Port+Offset+Configuration" target="_blank">Offset the port</a> of WSO2 MB to '1' </li>
<li>Copy andes-client-*.jar and geronimo-jms_1.1_spec-*.jar from $MB_HOME/client-lib to $ESB_HOME/repository/components/lib </li>
<li>Start the WSO2 MB</li>
</ul>
<div>
<h4>
Configure the WSO2 Enterprise Service Bus</h4>
</div>
<ul style="text-align: left;">
<li>Edit the $ESB_HOME/repository/conf/jndi.properties file (comment or delete any existing configuration)</li>
</ul>
<pre class="brush: bash">connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'
connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'
</pre>
<ul style="text-align: left;">
<li>Edit the $ESB_HOME/repository/conf/axis2.xml file and uncomment the JMS Sender and JMS Listener configuration for WSO2 Message Broker </li>
<li>Start the WSO2 ESB </li>
</ul>
<h4 style="text-align: left;">
Create Proxy Service </h4>
The Proxy Service name will become the queue name in WSO2 MB. If you already have a queue in MB and if you want to listen to that queue, then set that queue name as the proxy service name. Here I'm using 'JMSConsumerProxy' as the queue name and the proxy service name.<br />
<br />
<pre class="brush:xml"><?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="JMSConsumerProxy"
transports="jms"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="Action"
value="urn:placeOrder"
scope="default"
type="STRING"/>
<log level="full"/>
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<drop/>
</outSequence>
</target>
<description/>
</proxy> </pre>
<h4 style="text-align: left;">
Testing the scenario</h4>
<div>
<ul style="text-align: left;">
<li>Inside $ESB_HOME/samples/axis2Server/src/SimpleStockQuoteService run ant </li>
<li>Now start the Axis2 Server inside $ESB_HOME/samples/axis2Server (<a href="https://docs.wso2.com/display/ESB481/Setting+Up+the+ESB+Samples#SettingUptheESBSamples-StartingtheAxis2server" target="_blank">run the relevant command line script</a>) </li>
<li>Log into the WSO2 Message Broker Management Console and navigate to Browse Queues </li>
<li>Find a Queue by the name JMSConsumerProxy </li>
<li>Publish 1 message to the JMSConsumerProxy with payload (this has to be done in the Message Broker Management Console) </li>
</ul>
</div>
<pre class="brush:xml"><ser:placeOrder xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">
<ser:order>
<xsd:quantity>4</xsd:quantity>
</ser:order>
</ser:placeOrder></pre>
<div>
<ul style="text-align: left;">
<li>Observe the output on the Axis2 Server and WSO2 ESB console.</li>
</ul>
Hope this helped you :) </div>
<div>
<br /></div>
</div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com3tag:blogger.com,1999:blog-7793069411685567685.post-77147595013322207962014-02-28T11:09:00.003-08:002014-02-28T11:11:34.107-08:00Getting inside out of Social Data using WSO2 BAM & WSO2 CEP<div dir="ltr" style="text-align: left;" trbidi="on">
We engage in Social Media, but have we ever analysed the data it contains?<br />
<br />
Why we need to analyse?<br />
Can it help us to make prompt business decisions?<br />
How we can do that?<br />
<br />
I have done a screencast to answer all these,<br />
using <a href="http://wso2.com/products/business-activity-monitor/" target="_blank">WSO2 Business Activity Monitor</a> (2.4.0) and <a href="http://wso2.com/products/complex-event-processor/" target="_blank">WSO2 Complex Event Processor</a> (3.0.0).<br />
<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="390" src="//www.youtube.com/embed/w56kpuqX-s8" width="640"></iframe>
</div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com2tag:blogger.com,1999:blog-7793069411685567685.post-16542909501845390042013-04-10T10:55:00.002-07:002013-05-08T05:49:36.655-07:00Integrating WSO2 BAM & WSO2 CEP<div dir="ltr" style="text-align: left;" trbidi="on">
This post demonstrate how we can integrate both <a href="http://wso2.com/products/business-activity-monitor/">WSO2 BAM</a> and <a href="http://wso2.com/products/complex-event-processor/">WSO2 CEP</a> and run them as a single instance.<br />
<br />
To integrate both WSO2 BAM and WSO2 CEP we need to download BAM and install the CEP features form the WSO2 p2repo. Here I have used WSO2 BAM 2.2.0 and <a href="http://dist.wso2.org/p2/carbon/releases/4.0.7">4.0.7 p2repo</a>. Follow the wiki <a href="http://docs.wso2.org/wiki/display/BAM220/Server+Provisioning">link</a> to get to know how to install new features to existing products.<br />
<br />
<b><span style="font-size: large;">Testing the installation.</span></b><br />
To test the instillation add <a href="https://dl.dropbox.com/u/17922825/blog/CEP-in-BAM/broker-manager-config.xml">broker-manager-config.xml</a> to repository/conf/, and add <a href="https://dl.dropbox.com/u/17922825/blog/CEP-in-BAM/axis2_client.xml">axis2_client.xml</a> to repository/conf/axis2/.<br />
Here axis2_client.xml has the email sender information, and I'm using a demo email account for this.<br />
<br />
Then create a directory called 'cepbuckets' in repository/deployment/server/ and add <a href="https://dl.dropboxusercontent.com/u/17922825/blog/CEP-in-BAM/bam-cep-kpi-analyzer.xml">bam-cep-kpi-analyzer.xml</a> there.<br />
In bam-cep-kpi-analyzer.xml, you will be able to find a line<br />
<pre class="brush: xml"><cep:output brokerName="emailBroker" topic="wso2cep.demo@gmail.com/Phone Purchase Notification"></pre>
Change "<a href="mailto:wso2cep.demo@gmail.com">wso2cep.demo@gmail.com</a>" to the endpoint use email ID, who needs to receive the notification.<br />
<br />
Now if you run the KIP-analyser sample of BAM all the events that have totalPrice>350000 and quantity>3 will be notified to the user.</div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com22tag:blogger.com,1999:blog-7793069411685567685.post-44224819076805496682013-03-13T03:55:00.003-07:002013-03-13T04:14:56.561-07:00Monitoring ActiveMQ Queues via JMX MBeans with WSO2 Complex Event Processor (WSO2 CEP)<div dir="ltr" style="text-align: left;" trbidi="on">
WSO2 CEP and WSO2 Business Activity Monitor have support for JMX MBeans monitoring. You can find the docs for JMX MBeans monitoring for WSO2 BAM from <a href="http://wso2.org/library/articles/2013/02/jmx-monitoring-wso2-bam">here</a>.<br />
<br />
I'm writing this blog to illustrate how WSO2 CEP can be used to monitor the JMX MBeans, and I'm using ActiveMQ JMS broker as an example to demonstrate its capabilities.<br />
Here I have used apache-activemq-5.4.3<br />
<br />
<b>First we need to enable ActiveMQ JMS broker to support JMX remotely. </b><br />
<br />
To do so, you have to enable JMX in the broker, in the <activemq_home>/conf/activemq.xml:<br />
<div>
<pre class="brush: xml"><broker xmlns="http://activemq.org/config/1.0" brokerName="localhost" useJmx="true"></pre>
</div>
<div>
and </div>
<pre class="brush: xml"><managementContext>
<managementContext connectorPort="1099" />
</managementContext>
</pre>
<div>
Now you have to enable JMX in the JVM parameters in <activemq_home>/bin/activemq: </div>
<div>
Locate the line </div>
<div>
<pre class="brush: bash">ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS $SUNJMX $SSL_OPTS" </pre>
</div>
<div>
and change it to:
</div>
<div>
<pre class="brush: bash">ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS $SUNJMX $SSL_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
</pre>
</div>
<div>
<br /></div>
<div>
To test whether its correctly working run "jconsole"</div>
<div>
and connect to the
broker via: <a href="service:jmx:rmi:///jndi/rmi://your_host:1099/jmxrmi">service:jmx:rmi:///jndi/rmi://your_host:1099/jmxrmi</a></div>
<div>
<br /></div>
<div>
<b>Now we need to Enable to CEP to receive JMX Events</b><br />
<b><br /></b></div>
<div>
To do so first we need to install JMX Agent to CEP </div>
<div>
<br /></div>
<div>
Add 4.0.7 P2 repository form the URL http://dist.wso2.org/p2/carbon/releases/4.0.7</div>
<div>
as described at <a href="http://docs.wso2.org/wiki/display/CEP210/Managing+the+Feature+Repository">http://docs.wso2.org/wiki/display/CEP210/Managing+the+Feature+Repository</a></div>
<div>
<br /></div>
<div>
Next install the "BAM JMX Agent Aggregate" </div>
<div>
Use <a href="http://docs.wso2.org/wiki/display/CEP210/Installing+Features">http://docs.wso2.org/wiki/display/CEP210/Installing+Features</a> for guidence</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixhduWF8RS72lLDz3viYHWgoXC1QiBu9ik4p-wZfr8-_ljEoBtm8NDWEuf55Q98sU2yrwuk3RkEEuZKP0qF6svU36LoLiCadr9A7GKzDkdFp-rr4tAAv4BQGbckY2bjlrgwUyH3bsV4FTI/s1600/install-JMX.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="416" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixhduWF8RS72lLDz3viYHWgoXC1QiBu9ik4p-wZfr8-_ljEoBtm8NDWEuf55Q98sU2yrwuk3RkEEuZKP0qF6svU36LoLiCadr9A7GKzDkdFp-rr4tAAv4BQGbckY2bjlrgwUyH3bsV4FTI/s640/install-JMX.png" width="640" /></a></div>
<div>
<br /></div>
<div>
Restart CEP.</div>
<div>
<br /></div>
<div>
<b>Now we need to configure JMX.</b><br />
<b><br /></b></div>
<div>
To do so, go to Configure -> JMX Agent </div>
<div>
Click on "Add Profile" and configure he profile as below</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS2eqnxUYTIixSm7toWpM0g84rvnvdyna_swOKcfdLawt4hUbZd6Lf-7pQUfys2Yf3t6g9rDehmmDiWh9RbrKGtSdTrXQEYxtph2MYtmfuDNGPDeWj4hwDIaWxOSAkK9884SqlR0cgLmfM/s1600/config-JMX-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS2eqnxUYTIixSm7toWpM0g84rvnvdyna_swOKcfdLawt4hUbZd6Lf-7pQUfys2Yf3t6g9rDehmmDiWh9RbrKGtSdTrXQEYxtph2MYtmfuDNGPDeWj4hwDIaWxOSAkK9884SqlR0cgLmfM/s640/config-JMX-1.png" width="586" /></a></div>
<div>
<br /></div>
<div>
Here use the Data Receiver user name & password as "admin" & "admin" </div>
<div>
JMX Server URL as <a href="service:jmx:rmi:///jndi/rmi://your_host:1099/jmxrmi">service:jmx:rmi:///jndi/rmi://your_host:1099/jmxrmi</a> </div>
<div>
and JMX Server user name & password as "admin" & "activemq" </div>
<div>
<br /></div>
<div>
Then click on the "Load Means" button to load the available MBeans, </div>
<div>
Note : ActiveMQ need to be up an running in-order to load its MBeans</div>
<div>
<br /></div>
<div>
Next when you click on the appropriate MBean a dropdown will appear showing its attributes. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixb8aiqIPdKHaes24Tkse_MrVjTJGfyHrcxxZyer45mWhj634UCvfvXpQHqG5u5J0zObbZGOuwxPyEpZpy-JFtegk-Bf2N5Q2PuF39BvEwn8CREh7AArHDycTJNuT9T0B8aHxs9PAMEpvh/s1600/config-JMX-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="460" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixb8aiqIPdKHaes24Tkse_MrVjTJGfyHrcxxZyer45mWhj634UCvfvXpQHqG5u5J0zObbZGOuwxPyEpZpy-JFtegk-Bf2N5Q2PuF39BvEwn8CREh7AArHDycTJNuT9T0B8aHxs9PAMEpvh/s640/config-JMX-2.png" width="640" /></a></div>
<div>
<br /></div>
<div>
You have to select your relevant attributes one by one from the drop down. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhceWfS9IbrxQjK6rv1l2CmJ6kcL0sMV4uUw9K9U1N-pn5GLJ5ceGC6mMmjv2WS9nVaE9haNtrOgYJV_sN3Ojob1Tisq0aIvy9b_CtUK-hsi4SP6LAYEl6ut9AYjzFAP6GMuu8C2WKwOo2H/s1600/config-JMX-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="115" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhceWfS9IbrxQjK6rv1l2CmJ6kcL0sMV4uUw9K9U1N-pn5GLJ5ceGC6mMmjv2WS9nVaE9haNtrOgYJV_sN3Ojob1Tisq0aIvy9b_CtUK-hsi4SP6LAYEl6ut9AYjzFAP6GMuu8C2WKwOo2H/s640/config-JMX-3.png" width="640" /></a></div>
<div>
</div>
<div>
You also need to change the Alias to a much readable strings, </div>
<div>
For this Example I have used:</div>
<div>
BrokerName, TotalEnqueueCount, TotalDequeueCount, TotalMessageCount, MemoryPercentUsage</div>
<div>
<br /></div>
<div>
Now click "Save" to save & deploy the JMX Agent.<br />
<br />
When we add the above configuration JMX agent will automatically create the following WSO2 Event Stream Definition<br />
<br />
<pre class="brush: js">{
"streamId": "org.wso2.bam.jmx.agent.activemq:1.0.0",
"name": "org.wso2.bam.jmx.agent.activemq",
"version": "1.0.0",
"nickName": "JMX Dump",
"description": "JMX monitoring data",
"metaData": [{
"name": "clientType",
"type": "STRING"
}, {
"name": "host",
"type": "STRING"
}],
"payloadData": [{
"name": "BrokerName",
"type": "STRING"
}, {
"name": "TotalEnqueueCount",
"type": "LONG"
}, {
"name": "TotalDequeueCount",
"type": "LONG"
}, {
"name": "TotalMessageCount",
"type": "LONG"
}, {
"name": "MemoryPercentUsage",
"type": "INT"
}]
}
</pre>
<br /></div>
<div>
Next step is creating a CEP Bucket to use JMX event. </div>
<div>
To do this:</div>
<div>
<ul style="text-align: left;">
<li>Shutdown CEP </li>
<li>Run "ant deploy-broker-manager" from <cep_home>/samples/cep-samples</li>
<li>Copy paste activemq-all-xxx.jar from the <activemq_home> directory to <cep_home>/samples/lib directory. </li>
<li>Copy paste activemq-core-xxx.jar and geronimo-j2ee-management_1.1_spec-1.0.1.jar from <activemq_home>/lib to <cep_home>/repository/components/lib directory.</li>
<li>Copy the <a href="https://dl.dropbox.com/u/17922825/blog/JMX-Agent/queue-monitor.xml">queue-monitor.xml</a> to <cep_home>/repository/deployment/server/cepbuckets</li>
<li>In a new terminal run "ant jmsSubscriber -Dtopic=QueueInfo" from <cep_home>/samples/cep-samples to receive the outputs of the queue-monitor bucket.</li>
<li>Start CEP </li>
</ul>
<div>
Now try running the Queue example which is in the <amq_home>/example.</div>
<div>
In a new terminal run "ant consumer" to run the sample consumer </div>
<div>
In a new terminal run "ant producer" to send some sample messages to the ActiveMQ Queue. </div>
<div>
<br /></div>
<div>
you will be able to view some appropriate outputs in CEP QueueInfo jmsSubscriber</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyLkl5gYr5f2I8UJw2HRw_dofLl-t7_Fel0YI-aHPSeQh7ng_46nA87N2NiplJnyZnT0KBkedXmghrzm93xQMwGbBHmJt1-SBCy1yEfr4YgLT84Gen5Xw06Vp94g8x-FiFbZMKn0_hQdc_/s1600/JMX-output.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="342" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyLkl5gYr5f2I8UJw2HRw_dofLl-t7_Fel0YI-aHPSeQh7ng_46nA87N2NiplJnyZnT0KBkedXmghrzm93xQMwGbBHmJt1-SBCy1yEfr4YgLT84Gen5Xw06Vp94g8x-FiFbZMKn0_hQdc_/s400/JMX-output.png" width="400" /></a></div>
</div>
</div>Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com2tag:blogger.com,1999:blog-7793069411685567685.post-109417628286399092013-02-25T18:05:00.002-08:002013-02-27T18:27:06.617-08:00No connector available to access repository - FIXED! - Maven Wagon<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
When you try to deploy artifacts to Sonatype using <a href="http://www.google.com/url?sa=t&source=web&cd=1&sqi=2&ved=0CBMQFjAA&url=http%3A%2F%2Fmaven.apache.org%2Fdownload.html&ei=SxnTTM-nD8O88gbP9amuDg&usg=AFQjCNHZtmuoTGW1Kt1YrgUfa4n9xM0scg">maven 3</a>, If you encounter the following error, you probably have not configured Maven Wagon properly </div>
<div style="text-align: left;">
<br /></div>
<pre class="brush:shell; highlight: [10, 11, 12]" style="text-align: left;">[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.444s
[INFO] Finished at: Tue Feb 26 06:37:48 IST 2013
[INFO] Final Memory: 10M/981M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7
:deploy (default-deploy) on project test-core: Failed to deploy artifacts/metad
ata: No connector available to access repository xxx-maven2-repository (scp://x
xxx/maven2/) of type default using the available factories WagonRepositoryConne
ctorFactory -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swi
tch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please re
ad the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecution
Exception
</pre>
<div style="text-align: left;">
To fix this issue </div>
<ul style="text-align: left;">
<li>Add wagon extensions to your pom.</li>
</ul>
<pre class="brush:xml"> <build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.4</version>
</extension>
</extensions>
</build>
</pre>
<ul style="text-align: left;">
<li>Add distribution management segment to your pom.</li>
</ul>
<pre class="brush:xml" style="text-align: left;"> <distributionManagement>
<repository>
<id>xxx-maven2-repository</id>
<name>Xxx Maven2 Repository</name>
<url>scp://xxxx/maven2/</url>
</repository>
<snapshotRepository>
<id>xxx-maven2-snapshot-repository</id>
<name>Xxx Maven2 Snapshot Repository</name>
<url>scp://xxxx/snapshots/maven2/</url>
</snapshotRepository>
</distributionManagement></pre>
<div style="text-align: left;">
Not it works !</div>
<div style="text-align: left;">
For more info on using extensions refer: <a href="http://maven.apache.org/guides/mini/guide-using-extensions.html">http://maven.apache.org/guides/mini/guide-using-extensions.html</a></div>
</div>Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com9tag:blogger.com,1999:blog-7793069411685567685.post-75481764076912227002013-02-18T10:11:00.004-08:002013-02-18T22:34:36.071-08:00Using Apache Qpid with WSO2 CEP<div dir="ltr" style="text-align: left;" trbidi="on">
Though WSO2 CEP 2.x.x can work with Qpid, it does not have samples that demonstrates this, where CEP only have samples for ActiveMQ.<br />
<br />
Here I'm providing steps to configure, and run some samples using Apache Qpid.<br />
<br />
First step is downloading and running Apache Qpid.<br />
You can download Qpid from the <a href="http://qpid.apache.org/" target="_blank">project web site</a>. Note, I have used Qpid java 0.18 for these samples, you can download that from <a href="http://archive.apache.org/dist/qpid/0.18/qpid-java-0.18.tar.gz" target="_blank">here</a>.<br />
<br />
Next, unzip and start the broker.<br />
<br />
Now to configure WSO2 CEP with Qpid JMS broker, follow the steps provided at <a href="http://docs.wso2.org/wiki/display/CEP210/Configuring+JMS-Qpid+Broker">Configuring JMS-Qpid Broker</a>.<br />
<br />
<h3 style="text-align: left;">
Test publishing and subscribing to JMS Map messages</h3>
<br />
Edit the jms-twitter-stockquote-analyser.xml provided at <cep_home>/samples/cep-samples/conf/buckets directory by changing the input and output broker names as, </cep_home><br />
<pre class="brush: xml"><bucket name="TwitterAndStockQuoteAnalyzer" xmlns="http://wso2.org/carbon/cep">
...
<input topic="AllStockQuotes" brokerName="qpidJmsBroker">
...
<input topic="TwitterFeed" brokerName="qpidJmsBroker">
...
...
<output topic="PredictedStockQuotes" brokerName="qpidJmsBroker">
...
</bucket></pre>
<br />
<div>
Here we are using the brokerName as "qpidJmsBroker", because we have define it so, when <a href="http://docs.wso2.org/wiki/display/CEP210/Configuring+JMS-Qpid+Broker">Configuring JMS-Qpid Broker</a>.</div>
<div>
<br /></div>
<div>
Next copy past this file to <cep_home>/repository/deployment/server/cepbuckets directory. </cep_home></div>
<div>
<br /></div>
<div>
To test the broker download the client code from <a href="https://dl.dropbox.com/u/17922825/blog/cep-210-jms-client-qpid.zip">here</a>, and unzip cep-210-jms-client-qpid.zip </div>
<div>
<br /></div>
<div>
To subscribe to the PredictedStockQuotes topic, in the terminal go to cep-210-jms-client-qpid directory and run:</div>
<div>
<pre class="brush: shell">ant mapPredictedStockQuotesSubscriber
</pre>
</div>
<div>
<div>
To publish to the AllStockQuotes topic, in another terminal from the same directory, run:</div>
<div>
<pre class="brush: shell">ant mapAllStockQuotesPublisher
</pre>
</div>
</div>
<div>
<div>
To publish to the AllStockQuotes topic, in another terminal from the same directory, run:</div>
<div>
<pre class="brush: shell">ant mapTwitterFeedPublisher</pre>
</div>
</div>
<div>
Then you will be able to observe the outputs. Here the output will be similar to the output of <a href="http://docs.wso2.org/wiki/display/CEP210/Twitter+and+StockQuote+Analyzer">Twitter and StockQuote Analyzer</a> sample.<br />
<br /></div>
<h3 style="text-align: left;">
Test publishing and subscribing to JMS XML messages</h3>
<div>
<br />
Edit the xml-stockquote-anlyzer.xml provided at <cep_home>/samples/cep-samples/conf/buckets directory by changing the input and output broker names as, </cep_home><br />
<br />
<pre class="brush: xml"><cep:bucket name="XMLStockQuoteAnalyzer" xmlns="http://wso2.org/carbon/cep">
...
<cep:input topic="AllStockQuotes" brokerName="qpidJmsBroker">
...
...
<cep:output topic="FastMovingStockQuotes" brokerName="qpidJmsBroker">
...
</cep:bucket></pre>
<div>
</div>
</div>
<div>
<br /></div>
<div>
Here we are using the brokerName as "qpidJmsBroker", because we have define it so, when <a href="http://docs.wso2.org/wiki/display/CEP210/Configuring+JMS-Qpid+Broker">Configuring JMS-Qpid Broker</a>.</div>
<div>
<br /></div>
<div>
Next copy past this file to <cep_home>/repository/deployment/server/cepbuckets directory, and <b>make sure to delete other bucket configurations</b> in order to avoid conflicts.</cep_home></div>
<div>
<br /></div>
<div>
If you don't have the client code (used for the previous sample), download the client code from <a href="https://dl.dropbox.com/u/17922825/blog/cep-210-jms-client-qpid.zip">here</a>, and unzip cep-210-jms-client-qpid.zip, </div>
<div>
<br /></div>
<div>
To subscribe to the FastMovingStockQuotes topic, in the terminal go to cep-210-jms-client-qpid directory and run:</div>
<div>
<pre class="brush: shell">ant xmlFastMovingStockQuotesSubscriber</pre>
</div>
<div>
<div>
To publish to the AllStockQuotes topic, in another terminal from the same directory, run:</div>
<div>
<pre class="brush: shell">ant xmlAllStockQuotesPublisher
</pre>
</div>
</div>
<div>
</div>
<div>
You will be able to observe the outputs. Here the output will be similar to the output of <a href="http://docs.wso2.org/wiki/display/CEP210/Stock+Quote+Analyzer">Stock Quote Analyzer</a> sample.</div>
</div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com1tag:blogger.com,1999:blog-7793069411685567685.post-86436413042748727992013-02-16T11:28:00.000-08:002013-02-17T23:49:25.337-08:00Writing Custom Broker for WSO2 CEP<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
In this post I'll explain how to create a simple Custom Broker in <a href="http://wso2.com/products/complex-event-processor/" target="_blank">WSO2 CEP 2.1.x</a>.<br />
<br />
You can find a sample template Custom Broker project from <a href="https://dl.dropbox.com/u/17922825/blog/cep-ext-broker.zip" target="_blank">here</a>.<br />
<br />
The first step is to create a Java project (here I have used Apache Maven),<br />
then create an appropriate Broker Type by extending "org.wso2.carbon.broker.core.BrokerType" and an appropriate
Broker Type Factory by extending the "org.wso2.carbon.broker.core.BrokerTypeFactory" from the jar
org.wso2.carbon.broker.core-4.0.7.jar<br />
<br />
org.wso2.carbon.broker.core-4.0.7.jar will be available in the WSO2 public Maven Repository, which you can add to your project pom.xml as:<br />
<br />
<pre class="brush:xml"><repositories>
<repository>
<id>wso2-maven2-repository</id>
<name>WSO2 Maven2 Repository</name>
<url>http://dist.wso2.org/maven2</url>
</repository>
</repositories>
</pre>
</div>
<br />
else you can also find that at CEP_HOME/repository/components/plugins/ as org.wso2.carbon.broker.core_4.0.7.jar<br />
<br />
When extending the BrokerType, the BrokerTypeImpl has to implement the following methods.<br />
<br />
<pre class="brush:java">package org.wso2.carbon.broker.core;
import org.apache.axis2.engine.AxisConfiguration;
import org.wso2.carbon.broker.core.exception.BrokerEventProcessingException;
/**
* This is a broker type. these interface let users to publish subscribe messages according to
* some type. this type can either be local, jms or ws
*/
public interface BrokerType {
/**
* object which describes this type. it contains the name and available properties.
*
* @return - type dto
*/
BrokerTypeDto getBrokerTypeDto();
/**
* subscribe to the connection specified in the broker configuration.
*
* @param topicName - topic name to subscribe
* @param brokerListener - broker type will invoke this when it receive events
* @param brokerConfiguration - broker configuration details
* @throws BrokerEventProcessingException - if can not subscribe to the broker
*/
String subscribe(String topicName,
BrokerListener brokerListener,
BrokerConfiguration brokerConfiguration,
AxisConfiguration axisConfiguration) throws BrokerEventProcessingException;
/**
* publish a message to a given connection with the broker configuration.
*
* @param topicName - topic name to publish messages
* @param object - message to send
* @param brokerConfiguration - broker configuration to be used
* @throws BrokerEventProcessingException - if the message can not publish
*/
void publish(String topicName,
Object object,
BrokerConfiguration brokerConfiguration) throws BrokerEventProcessingException;
/**
* publish test message to check the connection with the broker configuration.
*
* @param brokerConfiguration - broker configuration to be used
* @throws BrokerEventProcessingException - if the message can not publish
*/
void testConnection(BrokerConfiguration brokerConfiguration) throws BrokerEventProcessingException;
/**
* this method unsubscribes the subscription from the broker.
*
* @param topicName
* @param brokerConfiguration
* @throws BrokerEventProcessingException
*/
void unsubscribe(String topicName,
BrokerConfiguration brokerConfiguration,
AxisConfiguration axisConfiguration, String subscriptionId)
throws BrokerEventProcessingException;
}
</pre>
<br />
Here you have to write the appropriate client code for both sending and receiving events.<br />
<br />
The publish() method in the BrokerType will be called when CEP is sending an output, your implementaion to publish the message needs to go under the publish() method. The input parameter message Object, of the publish() method can be either of the following,<br />
<ul style="text-align: left;">
<li>java.lang.String</li>
<li>java.util.Map</li>
<li>org.apache.axiom.om.OMElement</li>
<li>org.wso2.carbon.databridge.commons.Event</li>
</ul>
<ul style="text-align: left;">
</ul>
In your implementation you don't need to support all the message types, and supporting the appropriate type will be adequate. This is because at the bucket output mapping, user can select the appropriate message type mapping when sending the events.<br />
<br />
At the same time when a subscription was made for the subscribe() method the appropriate BrokerListener will be also provided, which is associated with the topic. BrokerListener also have a method onEvent(Object message) to which your client code receiving the incoming events has to pass the received messages. Here the events passed to the onEvent() must have one of the following format,<br />
<ul style="text-align: left;">
<li>java.util.Map</li>
<li>org.apache.axiom.om.OMElement</li>
<li>org.wso2.carbon.databridge.commons.Event</li>
</ul>
When extending the BrokerTypeFactory, the BrokerTypeFactoryImpl has to implement the getBrokerType() method.<br />
<br />
<pre class="brush:java">package org.wso2.carbon.broker.core;
public interface BrokerTypeFactory {
BrokerType getBrokerType();
}
</pre>
<br />
Then you have to build the jar and deploy that to the CEP server.<br />
<br />
If its a plain jar you have to add that to CEP_HOME/repository/components/lib or<br />
If its a OSGi bundle then you can add that to CEP_HOME/repository/components/dropings<br />
<br />
Next, you have to create a file called "broker.xml" at wso2cep-2.0.1/repository/conf directory, and add the implantation class as in the following XML:<br />
<br />
<pre class="brush:xml"><brokerTypes xmlns="http://wso2.org/carbon/broker">
<brokerType class="org.test.cep.broker.BrokerTypeFactoryImpl"/>
</brokerTypes>
</pre>
<br />
<b>Note: </b>In the above code snippet change the "org.test.cep.broker.BrokerTypeFactoryImpl" with your implementation class name.<br />
<br />
Finally, restart & login to the CEP server, go to Configure -> Broker -> Add, and there you will be able configure your custom broker.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsYS80lmQYlJluu6j51NVov9d7mvF9qMeHNHG7-_jMW4WHyG8rHtUa4hD9Kg_9IZr8MA3yCgcvvBk5doeqlPtBH0MRgJr_4WKPn3IYunYlsk9lZ2JVFKxZ6t_OBGsVQ3ObheETko8x8lQJ/s1600/custom-broker.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsYS80lmQYlJluu6j51NVov9d7mvF9qMeHNHG7-_jMW4WHyG8rHtUa4hD9Kg_9IZr8MA3yCgcvvBk5doeqlPtBH0MRgJr_4WKPn3IYunYlsk9lZ2JVFKxZ6t_OBGsVQ3ObheETko8x8lQJ/s640/custom-broker.png" width="640" /></a></div>
<br />
<br />
You will be able to download a sample template project from : <a href="https://dl.dropbox.com/u/17922825/blog/cep-ext-broker.zip">https://dl.dropbox.com/u/17922825/blog/cep-ext-broker.zip</a><br />
<br /></div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com24tag:blogger.com,1999:blog-7793069411685567685.post-82232138901392834952013-01-11T03:53:00.002-08:002013-02-15T03:39:32.786-08:00Using Siddhi CEP as a Java library<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<br /></div>
<div style="line-height: 115%; margin-bottom: 0in; page-break-after: auto; page-break-before: auto;">
<div style="text-align: justify;">
<a href="http://wso2.com/products/complex-event-processor/" target="_blank">WSO2 Complex Event processor</a> uses Siddhi as the Backend Runtime
Engine, which was initially developed at <a href="http://siddhi.sourceforge.net/">http://siddhi.sourceforge.net/</a><span style="line-height: 115%;">, and its development is
now being continued as a commons project of WSO2 Inc.</span></div>
</div>
<div style="line-height: 115%; margin-bottom: 0in; page-break-after: auto; page-break-before: auto;">
<div style="text-align: justify;">
Siddhi under Apache License V2, and its a product designed for real
time processing both in standalone mode and in distributed mode.
</div>
</div>
<div style="line-height: 115%; margin-bottom: 0in; page-break-after: auto; page-break-before: auto;">
<div style="text-align: justify;">
<br /></div>
</div>
<div style="line-height: 115%; margin-bottom: 0in; page-break-after: auto; page-break-before: auto;">
<div style="text-align: justify;">
Siddhi is basically a Java library that's embedded in WSO2 CEP server
to provide enterprise integration for Complex Event Processing.
</div>
</div>
<div style="line-height: 115%; margin-bottom: 0in; page-break-after: auto; page-break-before: auto;">
<div style="text-align: justify;">
<br /></div>
</div>
<div style="line-height: 115%; margin-bottom: 0in; page-break-after: auto; page-break-before: auto;">
<div style="text-align: justify;">
Since Siddhi is just a java library <a href="https://svn.wso2.org/repos/wso2/people/suho/packs/siddhi/siddhi-1.0.1-wso2v1-samples.zip" target="_blank">here</a> are some samples
demonstrating siddhi’s capabilities as a library.</div>
</div>
<div style="line-height: 115%; margin-bottom: 0in; page-break-after: auto; page-break-before: auto;">
<div style="text-align: justify;">
<br /></div>
</div>
<div style="line-height: 115%; margin-bottom: 0in; page-break-after: auto; page-break-before: auto;">
<div style="text-align: justify;">
You can find the WSO2 CEP product from: </div>
<div style="text-align: justify;">
<a href="http://wso2.com/products/complex-event-processor/">http://wso2.com/products/complex-event-processor/</a></div>
<div style="text-align: justify;">
<br /></div>
</div>
<div style="line-height: 115%; margin-bottom: 0in; page-break-after: auto; page-break-before: auto;">
<div style="text-align: justify;">
You can find the Siddhi source code from: </div>
<div style="text-align: justify;">
<a href="https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.0/dependencies/commons/siddhi/1.0.1-wso2v1">https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.0/dependencies/commons/siddhi/1.0.1-wso2v1</a></div>
<div style="text-align: justify;">
<br /></div>
</div>
<div style="line-height: 115%; margin-bottom: 0in; page-break-after: auto; page-break-before: auto;">
<div style="text-align: justify;">
You can find the Documentation for WSO2 CEP from: </div>
<div style="text-align: justify;">
<a href="http://docs.wso2.org/wiki/display/CEP201/Complex+Event+Processor+Documentation">http://docs.wso2.org/wiki/display/CEP201/Complex+Event+Processor+Documentation</a></div>
<div style="text-align: justify;">
<br /></div>
</div>
<div style="line-height: 115%; margin-bottom: 0in;">
<div style="text-align: justify;">
You can find the
Documentation for Siddhi Language Specification from: </div>
<div style="text-align: justify;">
<a href="http://docs.wso2.org/wiki/display/CEP201/Siddhi+Language+Specification">http://docs.wso2.org/wiki/display/CEP201/Siddhi+Language+Specification</a></div>
<div style="text-align: justify;">
<br /></div>
</div>
<div style="margin-bottom: 0in;">
<div style="text-align: justify;">
<span style="line-height: 18px;">You can find the Siddhi Library Sample from: </span></div>
<div style="text-align: justify;">
<span style="line-height: 18px;"><a href="https://svn.wso2.org/repos/wso2/people/suho/packs/siddhi/siddhi-1.0.1-wso2v1-samples.zip">https://svn.wso2.org/repos/wso2/people/suho/packs/siddhi/siddhi-1.0.1-wso2v1-samples.zip</a></span></div>
</div>
</div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com8tag:blogger.com,1999:blog-7793069411685567685.post-33423640466927804832012-12-08T09:16:00.002-08:002012-12-08T10:08:29.903-08:00Single Sign On across Web Applications and Web Services<div dir="ltr" style="text-align: left;" trbidi="on">
Here the requirement is to have a single sign on across Web application and Web Services. In more detail once the user is authenticated to access a WepApp he should not only be able to access other WepApps but those WebApps also should be able to access a set of back-end services with the logged in user's access rights with no further authentication. Here the back-end services can also be configured to authorize the user based on different user claims (E.g. email).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidp3Y5_f0YsqLFIWz70C04w8GMIDPXrn6uF3nm3Sc3goRSufVBWttsWVaaGhLIJ0qYsZRUZwHREuIV27P5NwURT2Hv17lJSY6v1VKTsLVQpRz6JRw3lyOqRS_rOJgxnD5u5kjNLlaHwtLE/s1600/sso-design.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="329" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidp3Y5_f0YsqLFIWz70C04w8GMIDPXrn6uF3nm3Sc3goRSufVBWttsWVaaGhLIJ0qYsZRUZwHREuIV27P5NwURT2Hv17lJSY6v1VKTsLVQpRz6JRw3lyOqRS_rOJgxnD5u5kjNLlaHwtLE/s1600/sso-design.png" width="640" /></a></div>
<br />
In the situation we can assume:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/blogger.g?blogID=7793069411685567685" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<blockquote class="tr_bq">
• trust relation between Identity Server and Resource Server (ESB Proxy),<br />
• trust relation between Identity Server and Resource Client (Web App)</blockquote>
The communications are:<br />
<blockquote class="tr_bq">
<br />
<ol style="text-align: left;">
<li>User connect to the Web App with is the “Resource Client”</li>
<li>WebApp finds out user is not authenticated and redirects to the SAML2 IdP.</li>
<li>SAML2 Idp checks whether the user has an authenticated session - if not will prompt for credentials, once authenticated there ,user will be redirected back to WebApp (Resource Client) with a SAML token, with the set of claims requested by the WebApp.</li>
<li>Now, the WebApp (Resource Client) needs to access a back-end web service with the logged in user's access rights. WebApp process the “SAML assertion token” and creates the STSToken from which it calls the Proxy Service (Resource server).</li>
<li>Proxy Service (Resource server) checks the “SAML assertion token” and allows access to the backend Web Service.</li>
</ol>
</blockquote>
This is tested with;<br />
<blockquote class="tr_bq">
• <a href="http://wso2.com/products/identity-server/" target="_blank">WSO2 Identity Server 4.0.0</a><br />
• <a href="http://wso2.com/products/enterprise-service-bus/" target="_blank">WSO2 Enterprise Service Bus 4.5.1</a><br />
• Apache Tomcat 7.0.25<br />
• Apache Subversion 1.6.12<br />
• Apache Maven 3.2.3<br />
• Java 1.6.0_26</blockquote>
<b>Steps,</b><br />
<b><br /></b>
<b>Step 1,</b><br />
<br />
Download and deploy WSO2 IS 4.0.0 from <a href="http://wso2.org/products/identity-server/" target="_blank">http://wso2.org/products/identity-server/</a><br />
<br />
<b>Step 2</b><br />
Download WSO2 ESB 4.5.1 from <a href="http://wso2.com/products/enterprise-service-bus/">http://wso2.com/products/enterprise-service-bus/</a>.<br />
When deploying ESB change the port offsets by 1, by editing<br />
<br />
<ESB_HOME>/repository/conf/carbon.xml file, and change the Offset element as follows<br />
<Offset>1</Offset><br />
<br />
<br />
<b>Step 3,</b><br />
<br />
Download and deploy Apache Tomcat<br />
<b><br /></b>
<b>Step 4,</b><br />
Checkout <a href="https://svn.wso2.org/repos/wso2/people/suho/sso-webapp-ws">https://svn.wso2.org/repos/wso2/people/suho/sso-webapp-ws</a> sso-webapp-ws<br />
This contains all the artifacts needed for this sample<br />
<br />
<b>Step 5,</b><br />
Setup WSO2 IS for SSO for Web Apps<br />
<ol style="text-align: left;">
<li>Login to IS</li>
<li>Click SAML SSO from the management console<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiepb83PYaX_8mNm76KBrvBuhxG5b0vgY9Th4abVTUgTZKq9p7Xobl3UQzOF-95HgqYKqjVXkmudw6vDmX2oFqoS-ie0rmbx3jT5NybBjFk3e5xy-IZCKWkCkPUKxrqdBPpgrrzbbnqLsYk/s1600/sso1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiepb83PYaX_8mNm76KBrvBuhxG5b0vgY9Th4abVTUgTZKq9p7Xobl3UQzOF-95HgqYKqjVXkmudw6vDmX2oFqoS-ie0rmbx3jT5NybBjFk3e5xy-IZCKWkCkPUKxrqdBPpgrrzbbnqLsYk/s320/sso1.png" width="149" /></a></li>
<li>Add SSO details<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR_ReprC_7lqiTz8nMD4gNDM6D6xlJjovPs-m7yd7TT8NficjReD-V1OneYGfdAzTwUgziZGSiFJde2jV5GN4UWB1K-zpGXU8-YTM6pY1yJFI2mDy4UkvGNZlnbuurqsJcAorkv1TdMwzt/s1600/sso2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="297" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgR_ReprC_7lqiTz8nMD4gNDM6D6xlJjovPs-m7yd7TT8NficjReD-V1OneYGfdAzTwUgziZGSiFJde2jV5GN4UWB1K-zpGXU8-YTM6pY1yJFI2mDy4UkvGNZlnbuurqsJcAorkv1TdMwzt/s640/sso2.png" width="640" /></a><br /><i>For the avis.com WebApp</i><br />Issuer: <a href="http://localhost:8081/avis.com/consumer">http://localhost:8081/avis.com/consumer</a><br />Assertion Consumer URL: <a href="http://localhost:8081/avis.com/consumer">http://localhost:8081/avis.com/consumer</a><br />Check “Enable Attribute Profile” and add the following claims<br /> http://wso2.org/claims/givenname<br /> http://wso2.org/claims/emailaddress<br /><i>For the travelocity.com WebApp</i><br />Issuer: <a href="http://localhost:8081/travelocity.com/consumer">http://localhost:8081/travelocity.com/consumer</a><br />Assertion Consumer URL: <a href="http://localhost:8081/travelocity.com/consumer">http://localhost:8081/travelocity.com/consumer</a><br />Check “Enable Attribute Profile” and add the following claims<br /> http://wso2.org/claims/givenname<br /> http://wso2.org/claims/emailaddress<br />When successfully added you will get Consumer Index for each entry<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPu2RM1VLO5TARNF5hBmUWjtewFhKmsOyN7sJouAvUD274x7NJQkfLdmxnA6cCWtZ8q9uQ0_bpGy9xnToSXhVyciHUtxJCHlhU16lPwmEXqifcbG1cJa9LDG2hvcyzzxvN1v83HStddwfF/s1600/sso3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="84" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPu2RM1VLO5TARNF5hBmUWjtewFhKmsOyN7sJouAvUD274x7NJQkfLdmxnA6cCWtZ8q9uQ0_bpGy9xnToSXhVyciHUtxJCHlhU16lPwmEXqifcbG1cJa9LDG2hvcyzzxvN1v83HStddwfF/s640/sso3.png" width="640" /></a><br />Now the SSO setup in the WSO2 IS is done.</li>
</ol>
<div>
<div>
<br /></div>
<div>
<b>Step 6,</b></div>
<div>
Configuring the WebApps</div>
<div>
<ol style="text-align: left;">
<li>You can add these by editing the war file or edit in the src-dist and build that.</li>
<li>Edit the WEB-INF/web.xml of each WebApp and add the appropriate “Consumer Index” returned by the WSO2IS as the param-value for AttributeConsumingServiceIndex.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqEQXvblOG_ZdoAk80svoEQNEfNkjfSb7rdY-W17vngP9sc3wHcFWlEK_4OC0nr1OwdhyphenhyphenKrEJ3poFQL2CtZ3qwU4Ih5J5u5Yyo_SDZqx-FXyrHHaVz_oDim3aEq5VkSjFXzcPBTV84KjUB/s1600/sso4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="442" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqEQXvblOG_ZdoAk80svoEQNEfNkjfSb7rdY-W17vngP9sc3wHcFWlEK_4OC0nr1OwdhyphenhyphenKrEJ3poFQL2CtZ3qwU4Ih5J5u5Yyo_SDZqx-FXyrHHaVz_oDim3aEq5VkSjFXzcPBTV84KjUB/s640/sso4.png" width="640" /></a></li>
<li>Edit the WEB-INF/classes/filepath.properties of each WebApp and add the appropriate<br />properties. You can find all the necessary files in the resources directory.<br />E.g.<br />keystore.file=/<path>/sso-webapp-ws/resources/keystore/wso2carbon.jks<br />repo.directory=/<path>/sso-webapp-ws/resources/repo<br />bearerpolicy.file=/<path>/sso-webapp-ws/resources/bearer-policy.xml<br />service.endpoint=<a href="http://localhost:8281/services/echoProxy">http://localhost:8281/services/echoProxy</a></li>
</ol>
<div>
<div>
<br /></div>
<div>
<b>Step 7,</b></div>
<div>
Add the proxy service</div>
<div>
<ol style="text-align: left;">
<li>Login to ESB</li>
<li>Click on Add Proxy Service from the management console<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWPjxW6c6HF_kmR2UY-cE-zcDZzkE_n7O_u5OD5uWZgirezBOhlbiVRZW_jol1cT_vBFvJasrU04kVNjLXhtFURXAtvv4yaOilTTotyHjGZk9jmg4vMyEjpKIpyce-6yZi4RymOsguF14s/s1600/sso5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWPjxW6c6HF_kmR2UY-cE-zcDZzkE_n7O_u5OD5uWZgirezBOhlbiVRZW_jol1cT_vBFvJasrU04kVNjLXhtFURXAtvv4yaOilTTotyHjGZk9jmg4vMyEjpKIpyce-6yZi4RymOsguF14s/s320/sso5.png" width="140" /></a></li>
<li>Create a Pass Through Proxy<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh60fRQT-YpznM_wMrv4P3d2xiA-4Q8IUA7Uis-Od74DnPQv58pYyQfh7mXjQdn8MVUAIvQd0CaMKP3_s0fTxdLCWLikVLzuyDBRbcmcGQhpNLb7YEGrzycyjRy7XG5m-cLxjKW0KyD17TD/s1600/sso6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh60fRQT-YpznM_wMrv4P3d2xiA-4Q8IUA7Uis-Od74DnPQv58pYyQfh7mXjQdn8MVUAIvQd0CaMKP3_s0fTxdLCWLikVLzuyDBRbcmcGQhpNLb7YEGrzycyjRy7XG5m-cLxjKW0KyD17TD/s640/sso6.png" width="640" /></a></li>
<li>Add the proxy name and endpoint<br />Proxy Service Name: echoProxy<br />Target Endpoint: “Enter URL”<br />Target URL: <a href="http://localhost:8281/services/echo">http://localhost:8281/services/echo</a><br />And click “Create”<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcuU0AKHs9Y8LcelYhxQaM2lcfL_zDnsstHNcOyOe4l_Gd6RvUL2PWlCdl_KjpyenXgAFinrNucTx0RYMVrKbgvtJO8NOtSyRE0UPMM3dLz77tHRkddKzwpfOCWlVSTQyFvdjfo75cjpPo/s1600/sso7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcuU0AKHs9Y8LcelYhxQaM2lcfL_zDnsstHNcOyOe4l_Gd6RvUL2PWlCdl_KjpyenXgAFinrNucTx0RYMVrKbgvtJO8NOtSyRE0UPMM3dLz77tHRkddKzwpfOCWlVSTQyFvdjfo75cjpPo/s640/sso7.png" width="640" /></a><br />Here the echo service (Endpoint service) is deployed on ESB by default</li>
</ol>
</div>
<div>
<div>
<br /></div>
<div>
<b>Step 8,</b></div>
<div>
Add the policy to the registry to secure the Proxy Service</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<ol style="text-align: left;">
<li>Click on Registry from the ESB management console<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxnx5nC2T-XFNsHvdA9Si0iKD1kBWENbH7mNwM4ZKO3WK94_hrSHy9RDY9kD3-qVHgJFHBvZwMoqYAJNLzB1MIInKxoWTcuetvYq9GACTxks70Y1loRPUbc8caMBM1KAq5GEWBXhDmJ1qM/s1600/sso8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxnx5nC2T-XFNsHvdA9Si0iKD1kBWENbH7mNwM4ZKO3WK94_hrSHy9RDY9kD3-qVHgJFHBvZwMoqYAJNLzB1MIInKxoWTcuetvYq9GACTxks70Y1loRPUbc8caMBM1KAq5GEWBXhDmJ1qM/s320/sso8.png" width="126" /></a></li>
<li>Navigate to /_system/config/repository and click on the repository<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8q-cV62kV8aRh2-CFnLkDbRhSFyc_Hhm79nOvhB7DR2pqkXr-xS_4pnZFGCzMSU6YiL8FpjeFaAoYfqMdZdliIuaU2bDIGwmswKiWp1E4BYu3Qzk4k1CUVgdFvxlHCWxzPS-6MUheW8ur/s1600/sso9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="353" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8q-cV62kV8aRh2-CFnLkDbRhSFyc_Hhm79nOvhB7DR2pqkXr-xS_4pnZFGCzMSU6YiL8FpjeFaAoYfqMdZdliIuaU2bDIGwmswKiWp1E4BYu3Qzk4k1CUVgdFvxlHCWxzPS-6MUheW8ur/s400/sso9.png" width="400" /></a></li>
<li>Under “Entries” click on the add recourses to add policy file<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipPl2yhTeFQu7i42nr4BcahS2B9L0khs9-f93PxwDJ0YpyoK5Qf_dCZJFHENkfCpazn8apKhmRi1hxBKem674s99kUfDZ-Kma3X_WO9fj0nYm6dEw-OZUPxczuWoCxU1FE4OvSE0Wjwi-e/s1600/sso10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="236" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipPl2yhTeFQu7i42nr4BcahS2B9L0khs9-f93PxwDJ0YpyoK5Qf_dCZJFHENkfCpazn8apKhmRi1hxBKem674s99kUfDZ-Kma3X_WO9fj0nYm6dEw-OZUPxczuWoCxU1FE4OvSE0Wjwi-e/s640/sso10.png" width="640" /></a></li>
<li>Now browse and add the bearer-policy.xml. This will be in the resources folder you<br />checked out. Click “Add” to add the file.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU-inF2Cqa8lW-6NT9F1qJs6HveckV-iiOT4xHIh2_cR_-xQweWXDF0nnfUcBW8ZC_B9AhWR46fFiXYAJ97ppk4tsVj0uPxG40p6GGez7qU1YR2_8cJ3LDbm-DTJeRgNwYlx24fvqTLgC1/s1600/sso11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="330" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU-inF2Cqa8lW-6NT9F1qJs6HveckV-iiOT4xHIh2_cR_-xQweWXDF0nnfUcBW8ZC_B9AhWR46fFiXYAJ97ppk4tsVj0uPxG40p6GGez7qU1YR2_8cJ3LDbm-DTJeRgNwYlx24fvqTLgC1/s640/sso11.png" width="640" /></a></li>
</ol>
</div>
</div>
</div>
</div>
</div>
<div>
<br /></div>
<div>
<div>
<b>Step 9,</b></div>
<div>
Securing the proxy service</div>
<div>
<ol style="text-align: left;">
<li>Click on List under services from the ESB management console, and click on “Unsecured” link next to the echoProxy service entry.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBpt-X318culGWrTTBFPmo2xab5gNhyphenhyphenga6vctoTpm1ETrmtzw3m7nQAiWqRWDMhQdUgnSC0Q7z4JK5kBRFEQvIcIVDCH2oE4yZBWaZfGN35CFCwd_8X-CY-NQtJHr7NjdcB3UNxtGRADiD/s1600/sso12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="171" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBpt-X318culGWrTTBFPmo2xab5gNhyphenhyphenga6vctoTpm1ETrmtzw3m7nQAiWqRWDMhQdUgnSC0Q7z4JK5kBRFEQvIcIVDCH2oE4yZBWaZfGN35CFCwd_8X-CY-NQtJHr7NjdcB3UNxtGRADiD/s640/sso12.png" width="640" /></a></li>
<li>Select “yes”<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr2-6brP9U7BEqTbY5lpvDGO3QV-5MAp1g886Epo9mdLqe6dZ2tSRWHVLTppBs156KtLoAtC1Y1IDaemCn8yZphtasdHBRePeYlZMiCBnay3ARM91eNQ5HT_WRt46vNnnFMbeasupB4Pt8/s1600/sso13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr2-6brP9U7BEqTbY5lpvDGO3QV-5MAp1g886Epo9mdLqe6dZ2tSRWHVLTppBs156KtLoAtC1Y1IDaemCn8yZphtasdHBRePeYlZMiCBnay3ARM91eNQ5HT_WRt46vNnnFMbeasupB4Pt8/s400/sso13.png" width="400" /></a></li>
<li>From the “Policy From Registry” section, click in Configuration registry to add policy from the cofig registry.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7RSyUCO2sMOUrDLOj0wnhMR-I48vRZfEemRHBs09wmDkGsbswVXkWs7-LMgxzCT2ZzSZ_I1390t3gNFgPtwWHp8ILMzml_l987xbZRj-71ON0L0snUZwecDVo2qSl_HmsTnwPqOb7s91-/s1600/sso14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="288" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7RSyUCO2sMOUrDLOj0wnhMR-I48vRZfEemRHBs09wmDkGsbswVXkWs7-LMgxzCT2ZzSZ_I1390t3gNFgPtwWHp8ILMzml_l987xbZRj-71ON0L0snUZwecDVo2qSl_HmsTnwPqOb7s91-/s640/sso14.png" width="640" /></a></li>
<li>Browse for the added “bearer-policy.xml” and click “OK”<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_mKYaH3w1xjNgavysXXHLz3cc9fPugnwGnUh4H4be4aEBzx8rZWGpvc8RGE-5hwXGI2JhTeLGlUoe2xu9ya1niTPPqWA0YB3OcNDegCI4HInLg5bL9tgyqihH6-nmguNKtJ1y6ICtcyB4/s1600/sso15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_mKYaH3w1xjNgavysXXHLz3cc9fPugnwGnUh4H4be4aEBzx8rZWGpvc8RGE-5hwXGI2JhTeLGlUoe2xu9ya1niTPPqWA0YB3OcNDegCI4HInLg5bL9tgyqihH6-nmguNKtJ1y6ICtcyB4/s400/sso15.png" width="400" /></a></li>
<li>Click “Next”, then click on the “admin” and “wso2carbon.jks” checkboxes, select the private key store as “wso2carbon.jks” and click on “Finish” to Activate Security.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkeTQXF2bb9A999l50aHNXQnpGWPJ-WP-9Y8kbDvDBorRQ3nAnuyxk8_gSOxZ5c5XmFm23SYhHoJ-qHBb4LfiD7h8OC5yLyxUYdhL-ewsXt6RwfRxeOToKbnBB34m2Oohyphenhyphen1EKIUTNbtU_h/s1600/sso16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkeTQXF2bb9A999l50aHNXQnpGWPJ-WP-9Y8kbDvDBorRQ3nAnuyxk8_gSOxZ5c5XmFm23SYhHoJ-qHBb4LfiD7h8OC5yLyxUYdhL-ewsXt6RwfRxeOToKbnBB34m2Oohyphenhyphen1EKIUTNbtU_h/s640/sso16.png" width="640" /></a></li>
</ol>
</div>
<div>
<b>Step 10,</b></div>
<div>
Deploy the webapps in Tomcat</div>
<div>
<br /></div>
<div>
<b>Step 11,</b></div>
<div>
Go to <a href="http://localhost:8081/travelocity.com">http://localhost:8081/travelocity%2Ecom</a> or <a href="http://localhost:8081/avis.com">http://localhost:8081/avis%2Ecom</a></div>
<div>
<ol style="text-align: left;">
<li>Enter following in the redirected page<br />User Name: admin<br />Password: admin<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3bUu_rGdgOIOXktqukfeHyxHuKGYc9dB-2-u_17GzmNnSuQxB1YOZ0fb0jWIun6ql9LbZh1270jrhnvtOiw41L7L4agoyx7SXjE4PaFt8PcV653bT8l3CZ1oYEcA11bPbVCV0hsWKEeBJ/s1600/sso17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="154" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3bUu_rGdgOIOXktqukfeHyxHuKGYc9dB-2-u_17GzmNnSuQxB1YOZ0fb0jWIun6ql9LbZh1270jrhnvtOiw41L7L4agoyx7SXjE4PaFt8PcV653bT8l3CZ1oYEcA11bPbVCV0hsWKEeBJ/s640/sso17.png" width="640" /></a><br />With successful login you will be redirected to the home page, where the Web App will be call the proxy using the “SAML assertion token” received at the SSO login.</li>
<li>With successful login at the Proxy Service you will get the following page<br />Note: Here the Web Service Response will be as “Hi WSO2”<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCEI-6ZejJ63aK03D4SBD1BxUaZAoDYy_rcjHDyP6rs0YeIBH396g40YKcMT0HDUomhzEtLtenNmQv9OmVbvKe7msW1Bo_9xp_pMRrpa4l44xzWJqRMiDufL6bUnikpQPCzaOtMMROpRSb/s1600/sso18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="376" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCEI-6ZejJ63aK03D4SBD1BxUaZAoDYy_rcjHDyP6rs0YeIBH396g40YKcMT0HDUomhzEtLtenNmQv9OmVbvKe7msW1Bo_9xp_pMRrpa4l44xzWJqRMiDufL6bUnikpQPCzaOtMMROpRSb/s640/sso18.png" width="640" /></a></li>
<li>If the login at the Proxy Service fails you will get the following page<br />Note: Here the Web Service Response will be as “’Hi WSO2’ expected but, no response from the web service”<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-lm_cEOOWnR-Y6l4Z6PHb4tVOlTLrULPr6Cu4KZKQwcMap_diuCrD6qw0fvv4Q2fh2OXGcmo1hhF7_8RJaVG2f05iWxqaXGuB5Ru2Mdxy2JG4Q0TnNQtGOGM8d7TBO94nJMmwPEunNXn2/s1600/sso19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="378" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-lm_cEOOWnR-Y6l4Z6PHb4tVOlTLrULPr6Cu4KZKQwcMap_diuCrD6qw0fvv4Q2fh2OXGcmo1hhF7_8RJaVG2f05iWxqaXGuB5Ru2Mdxy2JG4Q0TnNQtGOGM8d7TBO94nJMmwPEunNXn2/s640/sso19.png" width="640" /></a></li>
</ol>
</div>
</div>
<div>
<br />
I would like to thank the WSO2 forks; <strong style="font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 14px; line-height: 19px; text-align: -webkit-auto;">Suresh Attanayake</strong>, <strong style="font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 14px; line-height: 19px; text-align: -webkit-auto;">Prabath Siriwardena, & </strong><strong style="font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 14px; line-height: 19px; text-align: -webkit-auto;">Balachandiran Ajanthan</strong> for helping me on this.<br />
<br />
<br /></div>
</div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com8tag:blogger.com,1999:blog-7793069411685567685.post-30609143681759054962012-11-21T09:21:00.000-08:002013-02-16T08:33:16.969-08:00Enabling WSO2 ESB APIs to Pass-Through response Content-Types<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="margin-left: 1em; margin-right: 1em;">
</div>
<br />
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
This post explains how to configure WSO2ESB 4.5.x to Pass-Through response Content-Types.<br />
<br />
WSO2 ESB is build to work on soap environments therefore WSO2 ESB (proxy service) always
sends the response message in the same Content Type of the request, which is the
expected behaviour.<br />
This works fine for SOAP, because the incoming message to the proxy service and the outgoing messages from the proxy service are both SOAP messages.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTJezrbWS8mHS2anZ5EAe86Y_Us1VIryyY7R0eFLYl6bWXq8R6xkesjjHcUoH0nP9yubFcKW0OR8ANRqQ3JaU9t_aWQc6frnF6oXaOD4a2AOa0tXdeNGDdeg62MBMtIoVrqFb0KVeewuu3/s1600/rest.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTJezrbWS8mHS2anZ5EAe86Y_Us1VIryyY7R0eFLYl6bWXq8R6xkesjjHcUoH0nP9yubFcKW0OR8ANRqQ3JaU9t_aWQc6frnF6oXaOD4a2AOa0tXdeNGDdeg62MBMtIoVrqFb0KVeewuu3/s640/rest.png" /></a></div>
<br />
<br />
But this is not the case for REST calls, there can be cases where the proxy service need to mimic the actual service as it is.<br />
E.g. Client sends the request in the Content-Type to be "application/json" and the Actual service receives the request in the same "application/json" Content-Type and responds in the Content-Type of "text/plain" which the client can Accept.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNtd2oNhegk5lhzem8mXK7s8rMmB_9740Rr5AIi-N6QOsh-JOaomjUDF97Eru7K4EePng7buObeduKHR2IG6JoooeGGEklLoYD266JDRh39t2jBMg3aBXdg-KL-H5W3X6uKUbBrvZm-k5-/s1600/soap.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="113" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNtd2oNhegk5lhzem8mXK7s8rMmB_9740Rr5AIi-N6QOsh-JOaomjUDF97Eru7K4EePng7buObeduKHR2IG6JoooeGGEklLoYD266JDRh39t2jBMg3aBXdg-KL-H5W3X6uKUbBrvZm-k5-/s640/soap.png" width="640" /></a></div>
<br />
<br />
This can be achieved using <a href="http://docs.wso2.org/wiki/display/ESB451/Message+Relay">Message Relays</a>, but in any case if you need to achieve this for your custom formatters you have to manually set these Content-Type as below.<br />
<br />
<pre class="brush: xml"><api name="api_content_type_passthrough" context="/esbsanitycheck">
<resource methods="POST GET DELETE PUT">
<inSequence>
<send>
<endpoint key="ep_esb_sanity_check"/>
</send>
</inSequence>
<outSequence>
<b> </b><property name="messageType" expression="$trp:Content-Type" scope="axis2"/>
<b> </b><property name="ContentType" expression="$trp:Content-Type" scope="axis2"/>
<send/>
</outSequence>
</resource>
</api>
</pre>
</div>
</div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com2tag:blogger.com,1999:blog-7793069411685567685.post-30114404051241622922012-08-27T12:07:00.001-07:002012-08-28T07:14:46.306-07:00Distributed Processing Sample for WSO2 CEP<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Today we released <b><a href="http://wso2.com/products/complex-event-processing-server/" target="_blank">WSO2 Complex Event Processor</a> 2.0.0 Milestone 2</b>.<br />
This is available at <a href="https://svn.wso2.org/repos/wso2/people/suho/packs/cep/wso2cep-2.0.0-M2.zip" target="_blank">https://svn.wso2.org/repos/<wbr></wbr>wso2/people/suho/packs/cep/<wbr></wbr>wso2cep-2.0.0-M2.zip</a><br />
<br />
One of the key feature of this CEP is its support for distributed processing via Siddhi CEP Engine. To demonstrate its capability I came up with a sample on distributed Processing. This sample uses Siddhi CEP Engine for
processing and JMS ActiveMQ Broker to publish and subscribe events.<br />
<br />
To run the Distributed Processing Sample follow the steps give below;<br />
<br />
Step 01: Configure and run ActiveMQ in your local machine<br />
<div style="margin-left: 40px;">
Download the ActiveMQ from "<a href="http://activemq.apache.org/activemq-543-release.html" target="_blank">http://activemq.apache.org/<wbr></wbr>activemq-543-release.html</a>".<br />
unzip the distribution and run the ActiveMQ server using the command “./activemq console” from apache-activemq-xxx/bin (in Linux)<br />
<b>Note</b>: WSO2CEP has been tested with ActiveMQ 5.4.3</div>
<br />
For each CEP node in the cluster follow the steps from 02 to 08.<br />
<br />
Step 02: Deploy CEP server <br />
<div style="margin-left: 40px;">
Unzip the CEP server (Do not start the server).</div>
<br />
Step 03: Change the CEP server Offset.<br />
<div style="margin-left: 40px;">
If you are running multiple servers in the same machine change the offset<br />
from file "wso2cep-2.0.0-2/repository/<wbr></wbr>conf/carbon.xml" to different numbers. </div>
<div style="margin-left: 40px;">
E.g.
<pre class="brush: xml; toolbar: false;gutter: false;"><offset>1</offset></pre>
<br />
This is to overcome server port conflicts.<br />
E.g. If three WSO2 servers are going to be deployed in the same machine, they can have offsets as 1, 2, and 3.</div>
<br />
Step 04: Copy paste ActiveMQ jars. <br />
<div style="margin-left: 40px;">
Copy paste activemq-all-xxx.jar from the ActiveMQ home directory to </div>
<div style="margin-left: 40px;">
wso2cep-2.0.0/samples/lib directory.</div>
<div style="margin-left: 40px;">
Copy paste activemq-core-xxx.jar and geronimo-j2ee-management_1.1_<wbr></wbr>spec-1.0.1.jar<br />
from apache-activemq-xxx/lib to wso2cep-2.0.0/repository/<wbr></wbr>components/lib directory</div>
<br />
Step 06: Deploy required broker management configuration<br />
<div style="margin-left: 40px;">
This allows CEP to receive and send messages via JMS Broker.</div>
<div style="margin-left: 40px;">
To deploy run "ant deploy-broker-manager" from wso2cep-2.0.0/samples/cep-<wbr></wbr>samples directory.<br />
<br /></div>
Step 07: Configure input, output and queries<br />
<div style="margin-left: 40px;">
For this sample, the configurations of input, output and queries are at wso2cep-2.0.0-1/samples/cep-<wbr></wbr>samples/conf/buckets/purchase-<wbr></wbr>analyser-bucket.xml<br />
When running multiple server nodes each server need to receive the input
events through different topics. To enable this behaviour, open the
above file and change the input topics to have different names. The default input topic name is “PurchaseTopic”.</div>
<br />
<div style="margin-left: 40px;">
E.g changing the names to “PurchaseTopic1”.</div>
<div style="margin-left: 40px;">
<pre class="brush: xml; toolbar: false;">
<input brokername="activemqJmsBroker" topic="PurchaseTopic1" />
</pre>
</div>
<div style="margin-left: 40px;">
<br />
Note
: To enable distributed processing (already enabled for this sample)
the change we have to do is to make the "siddhi.enable.distributed.<wbr></wbr>processing" property to "true".</div>
<div style="margin-left: 40px;">
<br />
<pre class="brush: xml; toolbar: false;">
<engineproviderconfiguration engineprovider="SiddhiCEPRuntime">
<property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
<property name="siddhi.enable.distributed.processing">true</property>
</engineproviderconfiguration>
</pre>
</div>
</div>
<br />
Step 08: Deploy bucket configuration<br />
<div style="margin-left: 40px;">
Deploy the bucket by adding the configuration purchase-analyser-bucket.xml to the directory wso2cep-2.0.0/repository/<wbr></wbr>deployment/server/cepbuckets/<br />
<br /></div>
Step 09: Start all the servers<br />
<div style="margin-left: 40px;">
Start CEP servers by running "./wso2server.sh" from wso2cep-2.0.0/bin directory </div>
<br />
Step 10:Subscribing to output topic<br />
<div style="margin-left: 40px;">
Start the subscriber of the output topic "PurchaseResults" by running "ant purchaseResultsSubscriber" in a separate terminal, <br />
from wso2cep-2.0.0/samples/cep-<wbr></wbr>samples directory</div>
<br />
Step 11:Publishing events<br />
<div style="margin-left: 40px;">
To publish events to all the servers (to
their input topics as we defined in Step 07 ) run the publisher from
wso2cep-2.0.0/samples/cep-<wbr></wbr>samples directory <br />
with the command "ant purchasePublisher -Dtopics=xxx,xxx,..."<br />
The client will publish events to all the given topics in a round robin manner.<br />
<br />
E.g
If we we have configured the buckets to receive the inputs via the
input topics as PurchaseTopic1, PurchaseTopic2 and PurchaseTopic3</div>
<div style="margin-left: 40px;">
"ant purchasePublisher -Dtopics=PurchaseTopic1,<wbr></wbr>PurchaseTopic2,PurchaseTopic3.<wbr></wbr>"<b><br /></b><br />
<br /></div>
Step 12: Observation<br />
<div style="margin-left: 40px;">
You
will be able to observe how the counts in the results steadily increases when messages are sent to any of the servers, and how the results remain consistent even when some servers goes down and comes
back.</div>
<b>
</b>
</div>Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com4tag:blogger.com,1999:blog-7793069411685567685.post-8700247670964681192012-05-08T09:46:00.003-07:002013-02-16T08:27:11.274-08:00Setting brightness at Ubuntu startup<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
In Ubuthu machines such as
Thinkpad T520 every-time when we restart the computer the brightness
level will be at its maximum and then we need to manually set the
brightness to a comfortable level.<br />
<br />
To solve this issue here I share a small script I have written.<br />
<br />
First install xdotool<br />
<blockquote>
sudo apt-get install xdotool</blockquote>
This will allow you to change the brightness easily from the command line with out admin privileges.<br />
<br />
<br />
Check whether the brightness is changing with the following command<br />
<blockquote class="tr_bq">
xdotool key XF86MonBrightnessDown</blockquote>
<br />
Now we have to find the file where the brightness value is stored, try doing <br />
<blockquote class="tr_bq">
cat /sys/class/backlight/acpi_video0/brightness</blockquote>
If
you get an integer value then your good to proceed, else you have to
find the appropriate file in your system. In that case check in
/sys/class/<br />
<br />
<br />
Adjust the brightness and find your desired brightness level using the above command E.g. 9<br />
<br />
<br />
In this example I have used 9 as my brightness level change it according to you.<br />
<br />
<pre class="brush: bash">
#!/bin/bash
myBrightness=9;
currentBrightness=`cat /sys/class/backlight/acpi_video0/brightness`;
count=$(( $currentBrightness - $myBrightness )) ;
while [ $count -gt 0 ]
do
xdotool key XF86MonBrightnessDown
let count=$(($count-1));
done
</pre>
</div>
Save this as brightness.sh<br />
<br />
<br />
Then make this file to be an executable, by running<br />
<blockquote class="tr_bq">
chmod +x brightness.sh </blockquote>
<br />
Finally open the "Startup Applications" click Add and add the following<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG6GMn5A5xmw8TmwgcZooVN3fmJzWvrKsWzuzJiPD5wkfrbGA9AW4qsi_e3y0YVfJ6J3Vtm5fuc62d5veIoemuh8m85NsYJOWJZU8sevm3p5uCxo0TZVXqFRwz1mygw-MFU2DhKdCamNBh/s1600/brightness.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG6GMn5A5xmw8TmwgcZooVN3fmJzWvrKsWzuzJiPD5wkfrbGA9AW4qsi_e3y0YVfJ6J3Vtm5fuc62d5veIoemuh8m85NsYJOWJZU8sevm3p5uCxo0TZVXqFRwz1mygw-MFU2DhKdCamNBh/s1600/brightness.png" /></a></div>
<br />
<blockquote class="tr_bq">
<i>Name</i> :<span class="st"><</span>appropriate name><br />
<i>Command</i>:/<path to file from root>/brightness.sh<br />
<i>Comment</i>:<appropriate comment></blockquote>
</div>
Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com12tag:blogger.com,1999:blog-7793069411685567685.post-52035888617917494432012-05-08T04:17:00.000-07:002012-05-08T04:22:25.899-07:00How to install Java Cryptography Extension (JCE) unlimited strength jurisdiction policy files<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
How to over come "org.apache.xml.security.encryption.XMLEncryptionException: Illegal key size or default parameters" or "java.security.InvalidKeyException:illegal Key Size" error when invoking secured services<br />
<br />
These "org.apache.xml.security.encryption.XMLEncryptionException: Illegal key size or default parameters" or "java.security.InvalidKeyException:illegal Key Size" error usually occurs when we try to invoke a web services in a secured manner and your JVM is not provisioned for Java unlimited security jurisdiction.<br />
<br />
<br />
To provision for the Java unlimited security jurisdiction we have to install Java Cryptography Extension (JCE) unlimited strength jurisdiction policy files.<br />
<br />
<br />
<b>How to Install JCE</b><br />
<br />
<ol style="text-align: left;">
<li>Go to the Oracle Java SE download page <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html%20" target="_blank">http://www.oracle.com/technetwork/java/javase/downloads/index.html </a></li>
<li>Scroll down ... Under "Additional Resources" section you will find "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy File"</li>
<li>Download the version that matches your installed JVM E.g. UnlimitedJCEPolicyJDK7.zip</li>
<li>Unzip the downloaded zip </li>
<li>Copy local_policy.jar and US_export_policy.jar to the $JAVA_HOME/jre/lib/security (Note: these jars will be already there so you have to overwrite them)</li>
<li>Then restart your application to get rid of this exception.</li>
</ol>
</div>Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com257tag:blogger.com,1999:blog-7793069411685567685.post-78568286094150388772012-04-29T12:15:00.002-07:002012-04-29T12:16:51.398-07:00Change the default Java installation used by Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Though you have installed and using a particular Java installation (E.g. Oracle Java 7), sometimes when you install some other softwares they might change the default to other Java installations (E.g. OpenJDK)<br />
<br />
In such situations to change the default version, run the following commands and chose the appropriate selection when prompted.<br />
<br />
For Java :<br />
<blockquote class="tr_bq">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">update-alternatives --config java</span></span></blockquote>
For Java compiler :<br />
<blockquote class="tr_bq">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">update-alternatives --config javac</span></span></blockquote>
For Java web start :<br />
<blockquote class="tr_bq">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">update-alternatives --config javaws</span></span></blockquote>
</div>Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com10tag:blogger.com,1999:blog-7793069411685567685.post-53692203426076619682012-04-29T11:09:00.000-07:002012-04-29T11:12:49.546-07:00How to instal Java in Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="lib_entry_byline lib_entry_byline_article" style="font-family: Georgia,"Times New Roman",serif;">
This is replication of blog <a href="http://rootzwiki.com/topic/23008-howto-install-java-7-on-ubuntu-1204/">http://rootzwiki.com/topic/23008-howto-install-java-7-on-ubuntu-1204/</a><br />
<div class="sourceLine">
<br />
Here I give some brief note on how to Install Sun (Oracle) Java in Ubuntu and from <a href="http://suhothayan.blogspot.com/2010/02/how-to-set-javahome-in-ubuntu.html" target="_blank">How to set JAVA_HOME in Ubuntu</a> post you can get to know how to set your JAVA_HOME appropriately.<br />
<br />
<b>For Ubuntu 12.04 for Java 7 ... </b><br />
First in the terminal enter: <br />
<blockquote class="tr_bq">
<div style="font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">sudo add-apt-repository ppa:eugenesan/java<br />
sudo apt-get update</span></div>
</blockquote>
and then install...<br />
<blockquote>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">sudo apt-get install oracle-java7-installer </span></span></blockquote>
</div>
<div class="sourceLine">
This will give and error and stop...<br />
<br />
<b>Don't worry we can make this work :-)</b><br />
<br />
Go to <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html" target="_blank">Oracle Java site [http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html]</a> and download Java "jdk-7u3-linux-x64.tar.gz" directly from their site.<br />
<br />
Now, move the downloaded file to /var/cache/oracle-java7-installer/<br />
<blockquote>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">sudo mv Downloads/jdk-7u3-linux-x64.tar.gz /var/cache/oracle-java7-installer/</span></span></blockquote>
Then edit the<span class="pln"> oracle</span><span class="pun">-</span><span class="pln">java7</span><span class="pun">-</span><span class="pln">installer</span><span class="pun">.</span><span class="pln">postinst file:</span><br />
<blockquote>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">sudo gedit /var/lib/dpkg/info/oracle-java7-installer.postinst</span></span></blockquote>
To edit scroll down and find the following:<span class="pln"> </span><br />
<blockquote class="tr_bq">
<span class="pln"></span><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">echo "Downloading..."</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> rm -f $FILENAME</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> WGETRC=wgetrc wget $PARTNER_URL </span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> || fp_exit_with_error "download failed"</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> rm -f wgetrc</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> echo "Download done."</span></span></blockquote>
<span style="font-size: small;">And put a # in front of the lines between "</span><span style="font-family: "Courier New",Courier,monospace; font-size: x-small;">echo "Downloading..."</span><span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">" and "</span></span><span style="font-family: Georgia,"Times New Roman",serif; font-size: small;"><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">echo "Download done."</span></span>" as follows:</span></div>
<blockquote class="tr_bq">
<div class="sourceLine" style="text-align: left;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> echo "Downloading..."</span></span><br /><span style="font-size: x-small;">#rm -f $FILENAME </span><br /><span style="font-size: x-small;">#WGETRC=wgetrc wget $PARTNER_URL</span><br /><span style="font-size: x-small;">#|| fp_exit_with_error "download failed"</span><br /><span style="font-size: x-small;">#rm -f wgetrc</span><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> </span></span></div>
<div class="sourceLine" style="text-align: left;">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">echo "Download done."</span></span></div>
</blockquote>
<div class="sourceLine" style="text-align: left;">
Save the file and from your terminal run:<span style="font-size: x-small;"><br style="font-family: "Courier New",Courier,monospace;" /></span><br />
<blockquote>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> sudo apt-get install oracle-java7-installer</span></span></blockquote>
Now it works :-)<br />
<br />
Check it by running: <br />
<blockquote class="tr_bq">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">java -version </span></span></blockquote>
<br />
<b>For older versions of Ubuntu (11.10 and older)...</b><br />
First in the terminal enter:<br />
<blockquote class="tr_bq">
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"</span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> sudo apt-get update</span></span></blockquote>
and then install...<br />
<br />
<blockquote>
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">sudo apt-get install sun-java6-jdk </span></span><br />
<span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"> sudo apt-get install sun-java6-jre</span></span></blockquote>
<br /></div>
</div>
Now, Java is installed and we need to set the JAVA_HOME.<br />
Visit <a href="http://suhothayan.blogspot.com/2010/02/how-to-set-javahome-in-ubuntu.html" target="_blank">How to set JAVA_HOME in Ubuntu</a> post to get to know how you can appropriately set JAVA_HOME and PATH.</div>Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com3tag:blogger.com,1999:blog-7793069411685567685.post-39371980119842633492012-04-28T11:25:00.002-07:002012-04-29T20:17:52.589-07:00Apache MeetUp held in Hill Country<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br />
<br />
The students of <a href="http://www.pdn.ac.lk/">University of Peradeniya</a> did a great job organizing an amazing <a href="http://lanyrd.com/2012/apache-meetup-kandy/" target="_blank">Apache meet up at Kandy,</a> Sri Lanka. This was the second major event in Sri Lanka next to the <a href="http://suhothayan.blogspot.com/2012/02/apache-barcamp-colombo.html" target="_blank">Apache Bar Camp Colombo</a> that was held this year.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhshkCytcC2r-wAJMrINZ4tjhWMYs56nNYJ41BFs41NWa57OG_O97HT4SFfhiwoPyujl0ImJZCV3SrynzH77pn-mQLufrfMor1uE4OGQXVfYd3fHvJXBXAIfqyZNT9GTqaGKNL-0G7M_Hy6/s1600/Apache_MeetUp_Poster.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="138" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhshkCytcC2r-wAJMrINZ4tjhWMYs56nNYJ41BFs41NWa57OG_O97HT4SFfhiwoPyujl0ImJZCV3SrynzH77pn-mQLufrfMor1uE4OGQXVfYd3fHvJXBXAIfqyZNT9GTqaGKNL-0G7M_Hy6/s320/Apache_MeetUp_Poster.jpg" width="320" /></a></div>
<div style="text-align: justify;">
Here the first talk was on "FOSS in Kandy" by Dr. Nimal Rathnayaka, followed by Dr. Srinath Perera explaining "<a href="http://www.slideshare.net/hemapani/introduction-to-open-source-apache-and-apache-way" target="_blank">The Apache Way</a>" of managing projects, how the communities work together and how they resolve conflicts using the voting system with the -1 veto. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
After the introduction of open source and Apache, Nandika Jayawardrdana gave an inspiring speech on "Open source and your career" giving out some valuable informations to the audience how one can use open source to become much better at his career. Here he explained how open source can improve your communication skills, writing skills - where you have to convince and argue on your ideas via the mailing list, and how your participation on open source makes you famous - which indeed will be eye catching even at the selection phase for a grad school, and most importantly he also expressed how we get a self satisfaction when so many people are using the product that you have build. This also falls according to the famous saying "A project without users (means, it) does not exist". </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Following this, Sagara Gunathunga gave a good briefing on how you can "<a href="http://www.slideshare.net/sagara10/apache-contributionbar-campcolombo" target="_blank">Find your way to Apache Contribution</a>", Here he not only stressed on coding but also mentions some other great ways of contributing, like writing technical blogs on the project, helping with documentation and testing the project. He continued explaining how these are extremely valuable to do when you are a newbie and gain recognition from your project community. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
After lunch, we had two practical sessions, the first one is on how to configure and use Apache Web Server in an efficient manner - by Anuradha Ratnaweera, and the second was on "<a href="http://www.slideshare.net/suho/manen-ant-svn" target="_blank">Apache build projects</a>" - by Prabath Abeysekara and myself, where we demonstrated Apache Subversion, Maven and Ant. <br />
<div id="__ss_12729006" style="width: 425px;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<object height="355" id="__sse12729006" width="425"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=manen-ant-svn-120428132036-phpapp01&stripped_title=manen-ant-svn&userName=suho" />
<param name="allowFullScreen" value="true"/>
<param name="allowScriptAccess" value="always"/>
<param name="wmode" value="transparent"/>
<embed name="__sse12729006" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=manen-ant-svn-120428132036-phpapp01&stripped_title=manen-ant-svn&userName=suho" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="425" height="355"></embed></object></div>
<br />
Finally the session was concluded with Pradeeban's lighting talk on how to <a href="http://www.slideshare.net/kkpradeeban/community-matters111" target="_blank">build a community for your project</a>. </div>
</div>Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com3tag:blogger.com,1999:blog-7793069411685567685.post-55011559728139822322012-02-26T08:51:00.003-08:002012-03-04T03:40:41.956-08:00Apache BarCamp Colombo<div dir="ltr" style="text-align: left;" trbidi="on"><style type="text/css">
<!--
@page { margin: 0.79in }
P { margin-bottom: 0.08in }
-->
</style> <br />
<div style="text-align: justify;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwxHniOVyJaBInnhiOrK97I8ybN6j7YbL6M7NFMAB8oLwY6oQFrNrhowiMlymKVrBRJQEM0aAPlasANAO_xqp5R5KvpEr0PtCVIw091lui3t5vJg8FcA8YAc4L7oyBINoLnxVwSuMfikbN/s1600/BarCampApache_logo.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwxHniOVyJaBInnhiOrK97I8ybN6j7YbL6M7NFMAB8oLwY6oQFrNrhowiMlymKVrBRJQEM0aAPlasANAO_xqp5R5KvpEr0PtCVIw091lui3t5vJg8FcA8YAc4L7oyBINoLnxVwSuMfikbN/s320/BarCampApache_logo.png" width="320" /></a>We just had a wonderful <a href="http://barcamp.org/w/page/50716721/apache-lk-12">Apache BarCamp</a> here in Colombo at the UCSC Auditorium. The main motivation behind this activity is to promote open source contribution and give an inside into "Apache Way" of software development. Here I'm sharing some bits and pieces that stick to my mind.<br />
<br />
The session kicked off with an excellent keynote by Dr. Sanjiva Weerawarana, where he was talking on the interesting point on how Sri lanka eventually became the third largest contributor to Apache Software Foundation (ASF). There he mentioned how they initiated the first ever Sri Lankan open source development at a UCSC lab with four C++ programmers and how they were able to come up with AxisC++ which was then been shipped by IBM.<br />
<br />
Following Sanjiva, Ross Gardler took the floor and went on explaining “The Apache Way”, from what ASF is and how we could start and become a long term contributor. He clarified all important small words thats binds ASF like, Meritocracy where the action should speak louder than words, Lazy Consensus where “when you are convinced that you know what the community would like to see happening you can simply assume that you already have its support unless someone says otherwise” and the use of -1's where one should be opposing the arguments with valid points.<br />
<br />
The final key note was by Nick Burch, who did a wonderful job sharing his experience on what a pain he went through to apply his first patch, explaining how open source communities work and why we should not take things personally when they did not apply your patch or response to your queries. He gave a strong point on how developers might be busy on some other projects and in open source if you want things to happen the way you want you have to "Just F****** Do It" (JFDI). He ended up his great talk with the final touch by saying how open source development could be very fun and how it might even end up as an addiction.<br />
<br />
With all these three key notes we too had two other sessions where in one, Sagara Gunathunga was presenting they key steps that you will need when you "<a href="http://www.slideshare.net/sagara10/apache-contributionbar-campcolombo" target="_blank">Find your way to Apache contribution</a>" by giving some clear idea for all newbies to get a kickoff start.<br />
<br />
</div><div style="text-align: justify;">Finally we had an interesting session on "<a href="http://www.box.com/shared/xhfrp3mlyetfaeboms9z" target="_blank">How to prepare to Google Summer of Code 2012 with Apache projects</a>" motivating young undergraduates to take off the fear of open source and accept the challenge on doing GSOC 2012! Thanks Pradeeban for presiding the sessions and Nirmal and Eranda for sharing your experience with me to all the enthusiastic ordinance.<br />
<br />
</div><div style="text-align: justify;">We thank WSO2, Vertusa, ASF and UCSC for your help in sponsoring this great event.<br />
<br />
<br />
<br />
</div></div>Suhohttp://www.blogger.com/profile/11664808324539370702noreply@blogger.com2