How to setup Siddhi in Intellij IDEA
Siddhi is a java library that listens to events from data streams, detects complex conditions described via a Streaming SQL language, and triggers actions. It performs both Stream Processing and Complex Event Processing. You can run Siddhi with additional functionality in WSO2 Stream Processor as well.
In this article I’m going to talk about ,
- How to install Siddhi plugin in Intellij IDEA
- Setting up the Siddhi SDK
Let’s get started!
Installing Siddhi Plugin
NOTE: You need to have IntelliJ IDEA 2017.2.5 or above version to use the Siddhi plugin.
1)Go to File ->Settings (Preferences in MacOS) and select Plugins section.
2)Select Browse Repositories button at the bottom.
3) Search for Siddhi using the search box. Siddhi plugin will show up. Then you can install the plugin using the Install button.
4) After installing the plugin restart Intellij IDEA.
Setting up the Siddhi SDK
In order to run/debug siddhi you need to setup the Siddhi SDK. Download the latest available Siddhi SDK from here.
Siddhi SDK can be configured,
- When creating a new Siddhi project or
- After creating a Siddhi project
-> Setting up SDK when creating a new Siddhi project
1) Go to File -> New -> Project and select Siddhi project and select Next.
2) If you have previously configured the Siddhi SDKs, they will appear in the next window. You can select a SDK and continue with project creation by selecting Next.
If the Siddhi SDK was not configured previously, you can add a new Siddhi SDK by selecting Configure.
3) Select the Siddhi distribution location.
4) Now you have successfully added the Siddhi SDK. You can select Next and continue with project creation.
-> Setting up SDK after creating a Siddhi project
1) Go to File -> Project Structure and select Project tab. If you have previously added the Siddhi SDK, you can select the SDK from the drop down menu.
If a Siddhi SDK is not added previously, you can add a new SDK by selecting the New button under the Project SDK and selecting Siddhi SDK.
2) Select the Siddhi distribution location.
3) Now you have successfully added the Siddhi SDK to the project.
4) Select OK or Apply to save changes.
Good job! You have successfully configured Siddhi in Intellij IDEA. :D
Want to know how to create a Siddhi project and run/debug Siddhi files in Intellij IDEA? Then follow this article.