Skip to content

Siddhi Store RDBMS

Jenkins Build Status GitHub Release GitHub Release Date GitHub Open Issues GitHub Last Commit License

The siddhi-store-rdbms extension is an extension to Siddhi that persist and retrieve events to/from RDBMS databases such as MySQL, MS SQL, PostgreSQL, H2 and Oracle.

For information on Siddhi and it's features refer Siddhi Documentation.

Download

  • Versions 7.x & 6.x and above with group id io.siddhi.extension.* from here.
  • Versions 5.x and lower with group id org.wso2.extension.siddhi.* from here.

Latest API Docs

Latest API Docs is 7.0.5.

Features

  • cud (Stream Processor)

    This function performs SQL CUD (INSERT, UPDATE, DELETE) queries on data sources.
    Note: This function to work data sources should be set at the Siddhi Manager level.

  • query (Stream Processor)

    This function performs SQL retrieval queries on data sources.
    Note: This function to work data sources should be set at the Siddhi Manager level.

  • rdbms (Store)

    This extension assigns data sources and connection instructions to event tables. It also implements read-write operations on connected data sources.

Dependencies

JDBC connector jar should be added to the runtime. Download the JDBC connector jar based on the RDBMS type that is connected through the Siddhi store.

Installation

For installing this extension on various siddhi execution environments refer Siddhi documentation section on adding extensions.

Running Integration tests in docker containers(Optional)

The RDBMS functionality are tested with the docker base integration test framework, except the H2 default embedded database is not uses external docker container. The test framework initialize the docker container for each database according to the given profile before execute the test suit.

Start integration tests

  1. Install and run docker in daemon mode.

  2. To run the integration test, navigate to the siddhi-store-rdbms/ directory and issue the following commands.

    • H2 default:

      mvn clean install
      

      Note : h2 is the default activated profile as it is not used docker.

    • MySQL 5.7:

      mvn verify -P local-mysql -f /component/pom.xml -Dskip.surefire.test=true -Ddocker.removeVolumes=true
      
    • Postgres 9.6:

       mvn verify -P local-postgres -f /component/pom.xml -Dskip.surefire.test=true -Ddocker.removeVolumes=true
      
    • MSSQL CTP 2.0:

      mvn verify -P local-mssql -f /component/pom.xml -Dskip.surefire.test=true -Ddocker.removeVolumes=true
      
    • Oracle 11.2.0.2 Express Edition:

       mvn verify -P local-oracle -f component/pom.xml -Dskip.surefire.test=true -Ddocker.removeVolumes=true
      
    • Oracle 12.1.0.2 Standard Edition:

      • Download Oracle driver version 12.1.0.2 ojdbc7.jar

      • To install the JAR file as a Maven plugin, issue the following command:

          mvn install:install-file -Dfile=/tmp/ojdbc7.jar -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0.2 -Dpackaging=jar
        
      • Uncomment the following test dependency in the /component/pom.xml file as shown below:

          <dependency>
             <groupId>com.oracle</groupId>
             <artifactId>ojdbc7</artifactId>
             <scope>test</scope>
             <version>12.1.0.2</version>
          </dependency>
        
      • To run the integration test, navigate to siddhi-store-rdbms/ directory and issue the following commands:

          mvn verify -P local-oracle12 -f component/pom.xml -Dskip.surefire.test=true -Ddocker.removeVolumes=true
        
    • DB2

      • Download DB2 driver version 4.19.26 db2jcc4.jar

      • To install the JAR file as a Maven plugin, issue the following command:

         mvn install:install-file -Dfile=/tmp/db2jcc4.jar -DgroupId=com.ibm.db2 -DartifactId=db2jcc -Dversion=4.19.26 -Dpackaging=jar
        
      • Uncomment the following test dependency in the /component/pom.xml file as shown below:

         <dependency>
           <groupId>com.ibm.db2</groupId>
          <artifactId>db2jcc</artifactId>
           <scope>test</scope>
           <version>4.19.26</version>
         </dependency>
        
      • To run the integration test, navigate to siddhi-store-rdbms/ directory and issue the following commands:

         mvn verify -P local-db2 -f /component/pom.xml -Dskip.surefire.test=true -Ddocker.removeVolumes=true
        

Start integration tests in debug mode

mvn -P local-mysql -Dmaven.failsafe.debug verify
Note: local-mysql is the profile. Use other profiles accordingly.

Support and Contribution

  • We encourage users to ask questions and get support via StackOverflow, make sure to add the siddhi tag to the issue for better response.

  • If you find any issues related to the extension please report them on the issue tracker.

  • For production support and other contribution related information refer Siddhi Community documentation.