wso2-extensions / esb-inbound-dbevent

Apache License 2.0
0 stars 27 forks source link

esb-inbound-dbevent

The DB Event inbound endpoint allows you to capture the data change via WSO2 ESB.

Build

mvn clean install

How You Can Contribute

You can create a third party connector and publish in WSO2 Connector Store.

https://docs.wso2.com/display/ESBCONNECTORS/Creating+a+Third+Party+Connector+and+Publishing+in+WSO2+Connector+Store

Pre-requisites:

Tested Platform:

  1. To use the DB Event inbound endpoint, you need to download the inbound org.apache.synapse.dbevent.poll-1.0.0.jar from https://store.wso2.com and copy the jar to the /lib directory.

  2. Place the mysql-connector-java-5.1.36-bin.jar into the directory /lib.

  3. Configuration:

    <inboundEndpoint xmlns="http://ws.apache.org/ns/synapse"
                 name="customIE"
                 sequence="request"
                 onError="fault"
                 class="org.wso2.carbon.inbound.poll.dbeventlistener.DBEventPollingConsumer"
                 suspend="false">
    <parameters>
      <parameter name="inbound.behavior">polling</parameter>
      <parameter name="interval">10000</parameter>
      <parameter name="sequential">true</parameter>
      <parameter name="coordination">true</parameter>
      <parameter name="driverName">com.mysql.jdbc.Driver</parameter>
      <parameter name="url">jdbc:mysql://localhost/test</parameter>
      <parameter name="username">root</parameter>
      <parameter name="tableName">CDC_CUSTOM</parameter>
      <parameter name="filteringCriteria">byLastUpdatedTimestampColumn</parameter>
      <parameter name="filteringColumnName">LAST_UPDATED_DATE_TIME</parameter>
      <parameter name="primaryKey">ID</parameter>
      <parameter name="connectionValidationQuery">SELECT 1</parameter>
      <parameter name="registryPath">customIE/timestamp</parameter>
    </parameters>
    </inboundEndpoint>
  4. driverName - The class name of the database driver.

  5. url - The JDBC URL of the database.

  6. username - The user name used to connect to the database.

  7. password - The password used to connect to the database.

  8. tableName - The name of the table to capture the change.

  9. filteringCriteria - It can be one of these byLastUpdatedTimestampColumn or byBooleanColumn or deleteAfterPoll.

  10. filteringColumnName - The actual name of table column. It must be set if the filteringCriteria has the value 'byLastUpdatedTimestampColumn' or 'byBooleanColumn'.

  11. primaryKey - The primary key column name.

  12. connectionValidationQuery - The query to check the availability of the connection.

  13. registryPath - The registry path of the timestamp. This will be used to retrieve the records when the filteringCriteria has the value 'byLastUpdatedTimestampColumn'.