简体   繁体   中英

WSO2 Siddhi RDBMS Store Extension - how to set batchEnable to false

I'm using siddhi to create some app which also interacts with PostgreSQL DB. Although I'm not sure, I believe, there is a bug about making multiple updates on the same PG table, within a single event (ie upon receiving an event, update a record in the table, and create another one again in the same table) it seems the batch updates are causing some problems. SO, I just want to give it a try after disabling batchUpdate (it is enabled by default). I just don't know how to configure it using siddhi-sdk (via Intellij plugin). There are two related tickets: https://github.com/wso2-extensions/siddhi-store-rdbms/issues/43 https://github.com/wso2/product-sp/issues/472 Until these are documented, I'd like to get some quick response how to set these fields.

Best regards...

I'm using siddhi to create some app which also interacts with PostgreSQL DB. Although I'm not sure, I believe, there is a bug about making multiple updates on the same PG table, within a single event (ie upon receiving an event, update a record in the table, and create another one again in the same table) it seems the batch updates are causing some problems.

When batchEnabled has been set to true, it will perform the insert/update operation on batch of events instead of performing those operations on each and every single event. Simply, this has been introduced to improve the performance.

The default value of this parameter is currently set to "true". However, batchEnable configurations is done through a system parameter called, "{{RDBMS-Name}}.batchEnable" which have to be configured in the WSO2 Stream Processor's deployment.yaml

If you want to overide this property in Product-SP please find the steps below.

  1. Open the deployment.yaml file located in {Product-SP-Home}/conf/editor/

  2. Insert the following lines in the file.

siddhi: extensions: extension: name: store namespace: rdbms properties: PostgreSQL.batchEnable: true

But currently there is no way to overwrite those system configurations from the siddhi app level. Since you are using the SDK, what you can do is changing the default value of above parameter to " false ".

Please find the steps below do it.

  1. Find the siddhi-store-rdbms-4.x.xx.jar file in the siddhi sdk. This is located in the {siddhi-sdk-home}/lib/ .

  2. Open the jar file using an archive manager and open the rdbms-table-config.xml file located inside it with a text editor.

  3. Set false in <batchEnable>true</batchEnable> attribute under the <database name="PostgreSQL"> tag and save it.

Thanks Raveen. with a simple dash (-) before "extension" I was able to set the config.

siddhi: 
  extensions: 
   - extension:
       name: store
       namespace: rdbms
       properties: 
         PostgreSQL.batchEnable: false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM