Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

RDBMS event publisher is used to publish events in map format to a RDBMS in two execution modes, which are insert and update-insert.

...

  1. Create a datasource to connect to the selected database. For instructions on creating a datasource, see Adding Datasources.

    Info

    If selected database is H2, uncomment the following H2 database configurations in the <PRODUCT_HOME>/repository/config/carbon.xml file as follows, to browse through the database and see the changes. Keep the other properties of the  H2DatabaseConfiguration  element element uncommented.

    Code Block
    <H2DatabaseConfiguration>
    	<property name="web"/>
    	<property name="webPort">8082</property>
    	<property name="webAllowOthers"/>
    </H2DatabaseConfiguration>

...

Info

After entering the above adapter properties, select  the  select the Message Format   which you want to apply on the published events . Also, click click Advanced  to to define custom output mappings based on the the Message Format  you you selected. For more information on custom output mapping types, see Output Mapping Types .

Tip

An RDBMS publisher does not identify the persisted attributes of an event stream. If you want only the persisted attributes in the connected event stream to be published, the persisted attributes can be defined as advanced properties. For more information about persisting attributes, see Configuring Data Persistence.


You can also define define the respective adapter properties of the event publisher based on the transport type within the the <to>  element element of the event publisher configuration in the <PRODUCT_HOME>/repository/deployment/server/eventpublishers/ directory as follows.

...

Adapter Property
Description
Configuration file PropertyExample
Data Source NameName of the datasource
datasource.name
WSO2_CARBON_DB
Table Name Name of the table
table.name
sensordata
Execution Mode Type of the execution mode.
execution.mode
insert/update or insert
Composite key columns

Attributes used for uniqueness checks for updates. Use commas to separate if you enter more than one attribute.

Info

It is required to enter one or more attributes as composite key columns if you select update-or-insert for the Execution Mode parameterproperty.

update.keys

sensor-key,sensor-group

 

Related samples

For more information on rdbms event publisher type, see the following sample in WSO2 CEP Documentation.

...