This commit is contained in:
parent
4283a37bbf
commit
7ae4f09453
|
@ -1,4 +1,4 @@
|
|||
# MyCDC
|
||||
# MyCDC - MySQL change data capture
|
||||
|
||||
Application to run asynchronous operations based on DB changes. It is divided
|
||||
into three services:
|
||||
|
@ -10,7 +10,7 @@ relevant messages to each RabbitMQ queue.
|
|||
- Consumer: Obtains the elements from the queues and performs the necessary
|
||||
operations asynchronously.
|
||||
|
||||
## Enviroment setup
|
||||
## Environment setup
|
||||
|
||||
Because a bug with MariaDB wich it's fix is pending to be merged into main
|
||||
project branch, a *zongji* fork must be cloned into project root directory.
|
||||
|
@ -49,3 +49,4 @@ npm run consumer
|
|||
|
||||
* [Zongji](https://github.com/nevill/zongji)
|
||||
* [MySQL2](https://github.com/sidorares/node-mysql2#readme)
|
||||
* [RabbitMQ] (https://www.rabbitmq.com/)
|
||||
|
|
|
@ -30,13 +30,13 @@ module.exports = class QueueFk extends Queue {
|
|||
if (this.nMessages) {
|
||||
const {consumer} = this;
|
||||
|
||||
if (consumer.conf.debug)
|
||||
console.debug('Flush:'.blue, this.name.yellow, this.ids);
|
||||
|
||||
const scopes = this.scopes;
|
||||
const lastMessage = this.lastMessage;
|
||||
this.reset();
|
||||
|
||||
if (consumer.conf.debug)
|
||||
console.debug('Flush:'.blue, this.name.yellow, scopes);
|
||||
|
||||
try {
|
||||
for (const [scope, ids] of scopes) {
|
||||
let query = this.conf.query[scope];
|
||||
|
|
5
mycdc.js
5
mycdc.js
|
@ -318,7 +318,10 @@ module.exports = class MyCDC {
|
|||
case 'rotate':
|
||||
this.filename = evt.binlogName;
|
||||
position = evt.position;
|
||||
console.log(`[${eventName}] filename: ${this.filename}`, `position: ${this.position}, nextPosition: ${evt.nextPosition}`);
|
||||
console.log(
|
||||
`[${eventName}] filename: ${this.filename}`,
|
||||
`position: ${this.position}, nextPosition: ${evt.nextPosition}`
|
||||
);
|
||||
break;
|
||||
case 'writerows':
|
||||
case 'deleterows':
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mycdc",
|
||||
"version": "0.0.9",
|
||||
"version": "0.0.10",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "Asynchronous DB calculations reading the binary log",
|
||||
"license": "GPL-3.0",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
query:
|
||||
ticket: CALL vn.ticket_recalc(:id, NULL)
|
||||
client: CALL vn.ticket_recalcByScope(:table, :id)
|
||||
address: CALL vn.ticket_recalcByScope(:table, :id)
|
||||
client: CALL vn.ticket_recalcByScope('client', :id)
|
||||
address: CALL vn.ticket_recalcByScope('address', :id)
|
||||
includeSchema:
|
||||
vn:
|
||||
ticket:
|
||||
|
|
|
@ -6,4 +6,4 @@ includeSchema:
|
|||
key: travelFk
|
||||
scope: travel
|
||||
columns:
|
||||
- travelfk
|
||||
- travelFk
|
||||
|
|
Loading…
Reference in New Issue