ddq-backend-mysql
v2.0.1
Published
A backend plugin that DeDuplicated Queue (DDQ) can use to communicate with a MySQL database
Downloads
1
Maintainers
Readme
DeDuplicated Queue MySQL Plugin
About
A MySQL plugin for the DeDuplicated Queue (DDQ) module.
Configuration
In order to get up and running, you'll need to fill out several config options. DDQ instantiates the DDQ MySQL Plugin and passes in a config file, so do not create another config file for the DDQ MySQL Plugin. Simply add these fields to your DDQ config and they will be utilized by the Plugin.
Here's an example of a DDQ config that would work with this plugin:
{
"backend": "MySQL"
"backendConfig": {
"database": "exampleDatabase",
"heartbeatCleanupDelayMs": 3000
"heartbeatLifetimeSeconds": 3,
"host": "localhost",
"password": "examplePassword",
"pollingDelayMs": 5000,
"port": 3306,
"table": "exampleTable",
"topics": [
"topic1",
"topic2",
null
],
"user": "exampleUser",
},
"heartbeatDelayMs": 1000,
"createMessageCycleLimit": 10
}
General
createMessageCycleLimit
- The max number of times the Plugin will attempt to create a record in the database after initially failing to do so.heartbeatCleanupDelayMs
- The minimum delay between two invocations of theheartbeatCleanup
method.heartbeatLifetimeSeconds
- A filtering option for theheartbeatCleanup
method.pollingDelayMs
- The minimum delay between two invocations of thepoll
method.topics
- The category or categories that a given instance of the Plugin is concerned with. This field is optional, and will benull
if left empty.
MySQL Specific
database
- Name of the database to use for this connection.host
- The hostname of the database you are connecting to. Default:localhost
password
- The password of that MySQL user.port
- The port number to connect to. Default:3306
table
- The table the MySQL commands will act on.user
- The MySQL user to authenticate as.deadlockCountLimit
- Limit of consecutive deadlocks allowed before emitting an error. The polling and restoring cycles by nature can cause deadlocks with multiple listeners started at the sametime with the same cycle delay.
This module doesn't support every config option that MySQL offers, but only those most pertinent to getting things working. The full suite of options can be found here: https://github.com/mysqljs/mysql#connection-options. If you'd like more options in this plugin supported, check out this contributing doc: https://github.com/tests-always-included/ddq-backend-mock/blob/master/CONTRIBUTING.md