KO
|
EN
gitlite — search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
siddhi-io-cdc
★ 17
Open GitHub ↗
Extension which consumes CDC events
Download README (.md)
Explore Similar Repositories
tbert
:
PyTorch port of BERT ML model
StopTLS
:
MitM proxy which performs opportunistic SSL/TLS stripping
wireguard
:
多用户脚本
lxc-service-snapshots
:
Run disposable (read-only then delete) Linux containers (LXC) to serve up OpenVPN (server only), Pi-Hole, or WireGuard.
flink-cep
:
flink-cep
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
siddhi-io-cdc
?
Download (.md)
Siddhi IO CDC =================== [](https://wso2.org/jenkins/job/siddhi/job/siddhi-io-cdc/) [](https://github.com/siddhi-io/siddhi-io-cdc/releases) [](https://github.com/siddhi-io/siddhi-io-cdc/releases) [](https://github.com/siddhi-io/siddhi-io-cdc/issues) [](https://github.com/siddhi-io/siddhi-io-cdc/commits/master) [](https://opensource.org/licenses/Apache-2.0) The **siddhi-io-cdc extension** is an extension to <a target="_blank" href="https://wso2.github.io/siddhi">Siddhi</a> that captures change data from databases such as MySQL, MS SQL, PostgreSQL, H2 and Oracle. For information on <a target="_blank" href="https://siddhi.io/">Siddhi</a> and it's features refer <a target="_blank" href="https://siddhi.io/redirect/docs.html">Siddhi Documentation</a>. ## Download * Versions 3.x and above with group id `io.siddhi.extension.*` from <a target="_blank" href="https://mvnrepository.com/artifact/io.siddhi.extension.io.cdc/siddhi-io-cdc/">here</a>. * Versions 2.x and lower with group id `org.wso2.extension.siddhi.*` from <a target="_blank" href="https://mvnrepository.com/artifact/org.wso2.extension.siddhi.io.cdc/siddhi-io-cdc">here</a>. ## Latest API Docs Latest API Docs is <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-cdc/api/2.0.17">2.0.17</a>. ## Features * <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-cdc/api/2.0.17/#cdc-source">cdc</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#source">Source</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;">The CDC source receives events when change events (i.e., INSERT, UPDATE, DELETE) are triggered for a database table. Events are received in the 'key-value' format.<br><br>There are two modes you could perform CDC: Listening mode and Polling mode.<br><br>In polling mode, the datasource is periodically polled for capturing the changes. The polling period can be configured.<br>In polling mode, you can only capture INSERT and UPDATE changes.<br><br>On listening mode, the Source will keep listening to the Change Log of the database and notify in case a change has taken place. Here, you are immediately notified about the change, compared to polling mode.<br><br>The key values of the map of a CDC change event are as follows.<br><br>For 'listening' mode: <br> For insert: Keys are specified as columns of the table.<br> For delete: Keys are followed by the specified table columns. This is achieved via 'before_'. e.g., specifying 'before_X' results in the key being added before the column named 'X'.<br> For update: Keys are followed followed by the specified table columns. This is achieved via 'before_'. e.g., specifying 'before_X' results in the key being added before the column named 'X'.<br><br>For 'polling' mode: Keys are specified as the columns of the table.In order to connect in to the database table for receive CDC events, url, username, password and driverClassName(in polling mode) can be provided in deployment.yaml file under the siddhi namespace as below, </p><pre> siddhi: extensions: - extension: name: 'cdc' namespace: 'source' properties: url: jdbc:sqlserver://localhost:1433;databaseName=CDC_DATA_STORE password: <password> username: <> driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver </pre><p style="word-wrap: break-word;margin: 0;"><br><br>***Preparations required for working with Oracle Databases in listening mode***<br><br>Using the extension in Windows, Mac OSX and AIX are pretty straight forward inorder to achieve the required behaviour please follow the steps given below<br><br> - Download the compatible version of oracle instantclient for the database version from [here](https://www.oracle.com/database/technologies/instant-client/downloads.html) and extract<br> - Extract and set the environment variable <code>LD_LIBRARY_PATH</code> to the location of instantclient which was exstracted as shown below<br> </p><pre> export LD_LIBRARY_PATH=<path to the instant client location> </pre><p style="word-wrap: break-word;margin: 0;"><br> - Inside the instantclient folder which was download there are two jars <code>xstreams.jar</code> and <code>ojdbc<version>.jar</code> convert them to OSGi bundles using the tools which were provided in the <code><distribution>/bin</code> for converting the <code>ojdbc.jar</code> use the tool <code>spi-provider.sh|bat</code> and for the conversion of <code>xstreams.jar</code> use the jni-provider.sh as shown below(Note: this way of converting Xstreams jar is applicable only for Linux environments for other OSs this step is not required and converting it through the <code>jartobundle.sh</code> tool is enough)<br> </p><pre> ./jni-provider.sh <input-jar> <destination> <comma seperated native library names> </pre><p style="word-wrap: break-word;margin: 0;"><br> once ojdbc and xstreams jars are converted to OSGi copy the generated jars to the <code><distribution>/lib</code>. Currently siddhi-io-cdc only supports the oracle database distributions 12 and above<br><br>*** Configurations for PostgreSQL***<br>When using listening mode with PostgreSQL, following properties has to be configured accordingly to create the connection.<br><br> ***slot.name***: (default value = debezium) in postgreSQL only one connection can be created from single slot, so to create multiple connection custom slot.name should be provided.<br> <br> ***plugin.name***: (default value = decoderbufs ) Logical decoding output plugin name which the database is configured with. Other supported values are pgoutput, decoderbufs, wal2json.<br><br> ***table.name***: table name should be provided as <schema_name>.<table_name>. As an example, public.customer <br><br><br>See parameter: mode for supported databases and change events.</p></p></div> ## Dependencies JDBC connector jar should be added to the runtime. Download the JDBC connector jar based on the database type that is being used. To identify the required JDBC connector jar, please refer to this debezium release <a href="https://debezium.io/releases/1.9/">documentation</a> In addition to that, there are some prerequisites that need to be met based on the CDC mode used. Please find them below. **Default mode (Listening mode):** Currently MySQL, PostgreSQL and SQLServer are supported in Listening Mode. To capture the change events, databases have to be configured as shown below. * MySQL - https://debezium.io/documentation/reference/connectors/mysql.html#setup-the-mysql-server * PostgreSQL - https://debezium.io/docs/connectors/postgresql/#setting-up-PostgreSQL * SQLServer - https://debezium.io/docs/connectors/sqlserver/#setting-up-sqlserver **Polling mode:** * Change data capturing table should be have a polling column. Auto Incremental column or Timestamp can be used. Please see API docs for more details about change data capturing modes. ## Installation For installing this extension on various siddhi execution environments refer Siddhi documentation section on <a target="_blank" href="https://siddhi.io/redirect/add-extensions.html">adding extensions</a>. ## Running Integration tests in docker containers(Optional) The CDC functionality are tested with the docker base integration test framework. The test framework initialize a docker container with required configuration before execute the test suit. **Start integration tests** 1. Install and run docker 2. To run the integration tests, navigate to the siddhi-io-cdc/ directory and issue the following commands. * H2 default: mvn clean install * MySQL 5.7: mvn verify -P local-mysql -Dskip.surefire.test=true * Postgres 9.6: mvn verify -P local-postgres -Dskip.surefire.test=true * MSSQL: mvn verify -P local-mssql -Dskip.surefire.test=true * Oracle 11.2.0.2-xe: mvn verify -P local-oracle -Dskip.surefire.test=true ## Support and Contribution * We encourage users to ask questions and get support via <a target="_blank" href="https://stackoverflow.com/questions/tagged/siddhi">StackOverflow</a>, 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 <a target="_blank" href="https://github.com/siddhi-io/siddhi-execution-string/issues">the issue tracker</a>. * For production support and other contribution related information refer <a target="_blank" href="https://siddhi.io/community/">Siddhi Community</a> documentation.