I did my internship at WSO2 with the Analytics and SP team. This is one of the projects done by me during the internship period.
Before going through the project in detail lets have a brief understanding about What is the WSO2 Stream Processor, what is the Stream Processor Studio and what is a Siddhi Application in order to understand the use of this feature according to the users perspective.
What is the Stream Processor?
WSO2 Stream Processor (WSO2 SP) is packed with features that will enable any enterprise to build streaming analytic capabilities and derive meaningful insights out of the organisation data.
Meanwhile WSO2 SP is powered by Siddhi, a leading Open Source stream processing project.
What is the Stream Processor Studio?
It can be considered as the inbuilt editor having event stimulation and debugging support which can help you to create real-time applications much faster than before.
What is a Siddhi Application?
A siddhi application is a file which is considered as the deployment artifact containing Stream Processing logic for WSO2 Stream Processor.
Need For Deploying Siddhi Applications
A Siddhi application (.siddhi file) which is developed in the SP Studio can be deployed in order to run that on production.
There are two modes of deployment,
- Standard Deployment, here we deploy Siddhi Apps in worker node (In Single node, Minimum HA Deployments).
- Fully Distributed Deployment, here we deploy Siddhi Apps in manager node (Only in Fully Distributed Deployment).
This feature is developed for the Standard deployment where it allows a user to deploy selected Siddhi Apps to preferred servers through the SP Studio.
In Standard Deployment Siddhi Apps can be deployed to worker node by using one of the following methods,
- Dropping the
.siddhifile in to the
<SP_HOME>/wso2/worker/deployment/siddhi-files/directory before or after starting the worker node.
- Sending a “POST” request to
http://<host>:<port>/siddhi-appswith the Siddhi App included in the body of the request.
This process was bit difficult and time consuming because the user has to perform several steps to get it done. Therefor it was really important to find an approach to over come this.
Implementing a “deploy” feature as a top level menu item having “deploy to server” option listed under that in the SP Editor.
Front end and back end was developed using Java Script and Java respectively.
How to use
- First navigate to “Deploy” menu item and select “Deploy To Server” option or you can also use Shift+D keyboard shortcut.
- Then “Deploy To Server” dialog will popup.
- All the Siddhi Apps saved in the Editor Workspace are listed under “Siddhi Apps To Deploy”.
- A user can select one or more Siddhi Apps by checking the checkbox in front of the Siddhi App name.
- Then a user can select the required servers where the selected Siddhi Apps should be deployed.
- Available servers are listed under “Servers” (These servers are previously added servers which are been stored in the local storage).
- If a required server is not available under the “Servers” list, you can add it using the “Add New Server”.
- There are four fields to be filled as Host, Port, User Name and the Password.
- Fill those fields with the appropriate Host, Port, User Name and the Password for the required worker node and click on the “Add” button.
- Then the New Server will be available under the Servers list.
- After selecting the required Siddhi Apps And the Servers click on “Deploy” button.
- Finally “Deployment Status” will be generated.
- By going through it you can understand whether a specific Siddhi App is deployed successfully or not.
Hopefully this feature will be available with the next release.