mycdc/README.md

54 lines
1.3 KiB
Markdown
Raw Normal View History

2024-04-17 15:01:13 +00:00
# MyCDC - MySQL change data capture
2024-04-17 10:31:18 +00:00
Application to run asynchronous operations based on DB changes. It is divided
into three services:
- RabbitMQ: Service that allows the exchange and queuing of messages between
applications.
- Producer: Reads and filters changes from the DB binary log and adds the
relevant messages to each RabbitMQ queue.
- Consumer: Obtains the elements from the queues and performs the necessary
operations asynchronously.
2022-08-15 16:12:17 +00:00
2024-04-17 15:01:13 +00:00
## Environment setup
2022-08-16 11:45:51 +00:00
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.
More info at https://github.com/nevill/zongji/issues/143
2022-08-15 16:12:17 +00:00
```text
git clone https://github.com/juan-ferrer-toribio/zongji.git
cd zongji
git checkout fix-143
npm install
2022-08-15 16:12:17 +00:00
```
Apply *zongji.sql* script into DB.
2022-08-16 11:45:51 +00:00
2024-04-17 10:31:18 +00:00
Copy *producer.json* and *consumer.json* from *config* directory to
*producer.local.json* and *consumer.local.json* and place your local
configuration there.
2022-08-16 11:45:51 +00:00
2022-08-15 16:12:17 +00:00
Install dependencies.
```text
2022-08-16 11:45:51 +00:00
npm install
2022-08-15 16:12:17 +00:00
```
2022-08-16 11:45:51 +00:00
## Run application
2022-08-15 16:12:17 +00:00
Start rabbit.
2022-08-15 16:12:17 +00:00
```text
npm run rabbit
```
Start producer and consumer.
```text
npm start
npm run consumer
2022-08-15 16:12:17 +00:00
```
## Built With
* [Zongji](https://github.com/nevill/zongji)
* [MySQL2](https://github.com/sidorares/node-mysql2#readme)
2024-04-17 15:01:13 +00:00
* [RabbitMQ] (https://www.rabbitmq.com/)