Skip to content

Commit 2fc5b90

Browse files
committed
Updated to use @vlasky/mysql 2.18.5 that adds support for sending keepalive probe packets.
Can be enabled in the MySQL connection settings using the 'enableKeepAlive' and 'keepAliveInitialDelay' configuration options. Updated text and hyperlinks in README.md. Updated version to 0.5.7.
1 parent 7096a52 commit 2fc5b90

File tree

3 files changed

+26
-23
lines changed

3 files changed

+26
-23
lines changed

README.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
# ZongJi [![Build Status](https://travis-ci.org/nevill/zongji.svg?branch=master)](https://travis-ci.org/nevill/zongji)
2-
A MySQL binlog listener running on Node.js.
1+
A MySQL 8.0-compatible fork of ZongJi - a MySQL binlog listener for Node.js, [originally created by Nevill Dutt](https://github.com/nevill/zongji).
32

4-
ZongJi (踪迹) is pronounced as `zōng jì` in Chinese.
3+
[@vlasky/zongji](https://github.com/vlasky/zongji) has been tested working with MySQL 5.5, 5.6, 5.7 and 8.0.
54

6-
This package is a pure JS implementation based on [`mysql`](https://github.com/mysqljs/mysql). It has been tested to work in MySQL 5.5, 5.6, and 5.7.
5+
It leverages [`@vlasky/mysql`](https://github.com/vlasky/mysql), a fork of [`mysql`](https://github.com/mysqljs/mysql) with the following enhancements:
6+
7+
* Support for authentication using the caching_sha2_password plugin, the new default authentication method in MySQL 8.0
8+
* Partial support for the MySQL compressed protocol (reads compressed data sent by server)
9+
* Optional sending of keepalive probe packets to check the state of the connection to the MySQL server and help keep the connection open when the network socket is idle
710

811
# Latest Release
912

@@ -34,7 +37,7 @@ For a complete implementation see [`example.js`](example.js)...
3437
* Requires Node.js v8+
3538

3639
```bash
37-
$ npm install zongji
40+
$ npm install @vlasky/zongji
3841
```
3942

4043
* Enable MySQL binlog in `my.cnf`, restart MySQL server after making the changes.
@@ -91,7 +94,7 @@ Event Name | Description
9194

9295
Option Name | Type | Description
9396
------------|------|-------------------------------
94-
`serverId` | `integer` | [Unique number (1 - 2<sup>32</sup>)](http://dev.mysql.com/doc/refman/5.0/en/replication-options.html#option_mysqld_server-id) to identify this replication slave instance. Must be specified if running more than one instance of ZongJi. Must be used in `start()` method for effect.<br>**Default:** `1`
97+
`serverId` | `integer` | [Unique number (1 - 2<sup>32</sup>)](https://dev.mysql.com/doc/refman/5.0/en/replication-options.html#option_mysqld_server-id) to identify this replication slave instance. Must be specified if running more than one instance of ZongJi. Must be used in `start()` method for effect.<br>**Default:** `1`
9598
`startAtEnd` | `boolean` | Pass `true` to only emit binlog events that occur after ZongJi's instantiation. Must be used in `start()` method for effect.<br>**Default:** `false`
9699
`filename` | `string` | Begin reading events from this binlog file. If specified together with `position`, will take precedence over `startAtEnd`.
97100
`position` | `integer` | Begin reading events from this position. Must be included with `filename`.
@@ -108,11 +111,11 @@ Option Name | Type | Description
108111
Event name | Description
109112
------------|---------------
110113
`unknown` | Catch any other events
111-
`query` | [Insert/Update/Delete Query](http://dev.mysql.com/doc/internals/en/query-event.html)
114+
`query` | [Insert/Update/Delete Query](https://dev.mysql.com/doc/internals/en/query-event.html)
112115
`intvar` | [Autoincrement and LAST_INSERT_ID](https://dev.mysql.com/doc/internals/en/intvar-event.html)
113-
`rotate` | [New Binlog file](http://dev.mysql.com/doc/internals/en/rotate-event.html) Not required to be included to rotate to new files, but it is required to be included in order to keep the `filename` and `position` properties updated with current values for [graceful restarting on errors](https://gist.github.com/numtel/5b37b2a7f47b380c1a099596c6f3db2f).
114-
`format` | [Format Description](http://dev.mysql.com/doc/internals/en/format-description-event.html)
115-
`xid` | [Transaction ID](http://dev.mysql.com/doc/internals/en/xid-event.html)
116+
`rotate` | [New Binlog file](https://dev.mysql.com/doc/internals/en/rotate-event.html) Not required to be included to rotate to new files, but it is required to be included in order to keep the `filename` and `position` properties updated with current values for [graceful restarting on errors](https://gist.github.com/numtel/5b37b2a7f47b380c1a099596c6f3db2f).
117+
`format` | [Format Description](https://dev.mysql.com/doc/internals/en/format-description-event.html)
118+
`xid` | [Transaction ID](https://dev.mysql.com/doc/internals/en/xid-event.html)
116119
`tablemap` | Before any row event (must be included for any other row events)
117120
`writerows` | Rows inserted, row data array available as `rows` property on event object
118121
`updaterows` | Rows changed, row data array available as `rows` property on event object
@@ -139,19 +142,19 @@ Name | Description
139142
* install [Docker](https://www.docker.com/community-edition#download)
140143
* run `docker-compose up` and then `./docker-test.sh`
141144

142-
## Reference
145+
## References
143146

144-
I learnt many things from following resources while making ZongJi.
147+
The following resources provided valuable information that greatly assisted in creating ZongJi:
145148

146149
* https://github.com/mysqljs/mysql
147150
* https://github.com/felixge/faster-than-c/
148-
* http://intuitive-search.blogspot.co.uk/2011/07/binary-log-api-and-replication-listener.html
151+
* https://web.archive.org/web/20130117004733/https://intuitive-search.blogspot.co.uk/2011/07/binary-log-api-and-replication-listener.html
149152
* https://github.com/Sannis/node-mysql-libmysqlclient
150153
* https://kkaefer.com/node-cpp-modules/
151-
* http://dev.mysql.com/doc/internals/en/replication-protocol.html
152-
* http://www.cs.wichita.edu/~chang/lecture/cs742/program/how-mysql-c-api.html
154+
* https://dev.mysql.com/doc/internals/en/replication-protocol.html
155+
* https://web.archive.org/web/20200201195450/https://www.cs.wichita.edu/~chang/lecture/cs742/program/how-mysql-c-api.html
153156
* https://github.com/jeremycole/mysql_binlog (Ruby implemenation of MySQL binlog parser)
154-
* http://dev.mysql.com/doc/internals/en/date-and-time-data-type-representation.html
157+
* https://dev.mysql.com/doc/internals/en/date-and-time-data-type-representation.html
155158

156159
## License
157160
MIT

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@vlasky/zongji",
3-
"version": "0.5.6",
4-
"description": "A fork of nevill/zongji mysql binlog listener running on Node.js that uses @vlasky/mysql to allow partial support for the MySQL compressed protocol.",
3+
"version": "0.5.7",
4+
"description": "A MySQL 8.0-compatible fork of ZongJi - a MySQL binlog listener for Node.js.",
55
"main": "index.js",
66
"directories": {
77
"test": "test"
@@ -37,6 +37,6 @@
3737
"dependencies": {
3838
"big-integer": "1.6.48",
3939
"iconv-lite": "0.6.2",
40-
"@vlasky/mysql": "^2.18.4"
40+
"@vlasky/mysql": "^2.18.5"
4141
}
4242
}

0 commit comments

Comments
 (0)