Skip to content

Commit

Permalink
Merge pull request #3 from fivetran/upstream-merge
Browse files Browse the repository at this point in the history
Upstream merge
  • Loading branch information
glarwood authored Apr 29, 2019
2 parents af5043e + ff1e3e8 commit 7124322
Show file tree
Hide file tree
Showing 43 changed files with 2,141 additions and 316 deletions.
2 changes: 1 addition & 1 deletion .jabbarc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# https://github.com/shyiko/jabba
jdk: 1.6
jdk: 1.8
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-s .mvn/settings.xml
14 changes: 14 additions & 0 deletions .mvn/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

<servers>
<server>
<id>maven-central</id>
<username>${env.OSS_SONATYPE_ORG_USERNAME}</username>
<password>${env.OSS_SONATYPE_ORG_PASSWORD}</password>
</server>
</servers>

</settings>
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
distributionUrl=https://repository.apache.org/content/repositories/releases/org/apache/maven/apache-maven/3.2.5/apache-maven-3.2.5-bin.zip
distributionUrl=https://repository.apache.org/content/repositories/releases/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
language: java
jdk:
- openjdk6
script: './mvnw clean package -DskipTests=true'
env:
global:
- secure: QI6w4d/W9Sjckgcdwc/K5Rb+UFa6PxDbhiilv70fEZCXg0P4GMBFGD/zbpsfTlLbA9rgKBotrSm7EXRtQM94dluW0kS9jQiJfw33l9WbfMAJL4797xq+7ekvIvPBf7xVfwGsAcCcB5DcPBTKroX2s8tJEY3CQTienkW4pT7/zh0=
- secure: b/7SnPmS2BUrzc167F5sbI8ILNBqo3ODz9ZtuOOcXQ/9uJVgaLrB3KmKAHgIsjOiZ/PPp7qGNL4jW9CD7b7LAldMyIcszdKptc/fr2yHZkM17IuQJtL5tjBNlLkqeApW37ddPp0mp5IhhqzZMZ8Zu8/2vlyNJrVrYgnIXuoLLRE=
script: ./mvnw clean package -DskipTests=true
131 changes: 126 additions & 5 deletions changelog.md → CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,132 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.20.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.19.1...0.20.0) - 2019-04-20

### Added
- `mysql_native_password` auth support (Azure) ([#272](https://github.com/shyiko/mysql-binlog-connector-java/issues/272)).

## [0.19.1](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.19.0...0.19.1) - 2019-03-28

### Fixed
- `TABLE_MAP` event data deserialization on MySQL 8 ([#264](https://github.com/shyiko/mysql-binlog-connector-java/issues/264)).

## [0.19.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.18.1...0.19.0) - 2019-02-13

### Added
- [MySQL 8.0.1+ table metadata](https://mysqlhighavailability.com/more-metadata-is-written-into-binary-log/) support ([#251](https://github.com/shyiko/mysql-binlog-connector-java/issues/251)).

### Fixed
- `connect`/`disconnect` keepalive thread race condition ([#260](https://github.com/shyiko/mysql-binlog-connector-java/issues/260)).

## [0.18.1](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.18.0...0.18.1) - 2019-02-04

### Fixed
- Checksum detection when custom FORMAT_DESCRIPTION deserializer is set ([#258](https://github.com/shyiko/mysql-binlog-connector-java/issues/258)).

## [0.18.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.17.0...0.18.0) - 2019-01-21

### Added
- `BinaryLogClient` flag (`useBinlogFilenamePositionInGtidMode`) to control initial (requested on `connect()`) binlog position when GtidSet is set ([#254](https://github.com/shyiko/mysql-binlog-connector-java/issues/254)).

### Fixed
- Checksum detection ([#256](https://github.com/shyiko/mysql-binlog-connector-java/issues/256)).

## [0.17.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.16.1...0.17.0) - 2019-01-07

### Added
- CRC32 checksum auto-detection (BinaryLogFileReader) ([#160](https://github.com/shyiko/mysql-binlog-connector-java/issues/160)).

### Changed
- GtidSet tracking (GtidSet update is delayed until XID/QUERY(COMMIT)/QUERY(ROLLBACK)) ([#250](https://github.com/shyiko/mysql-binlog-connector-java/issues/250)).

### Fixed
- (potential) deadlock when calling disconnect() inside onDisconnect() ([250](https://github.com/shyiko/mysql-binlog-connector-java/issues/230)).

## [0.16.1](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.16.0...0.16.1) - 2018-04-12

### Fixed
- `DATE_AND_TIME_AS_LONG_MICRO` handling regression ([introduced in 0.15.0](https://github.com/shyiko/mysql-binlog-connector-java/commit/2530a83283ac681ae9ab8a99acfa6aa6b4e9d288#r28556787)).

## [0.16.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.15.0...0.16.0) - 2018-04-12

### Added
- `EventDeserializer.CompatibilityMode.INVALID_DATE_AND_TIME_AS_MIN_VALUE` ([#210](https://github.com/shyiko/mysql-binlog-connector-java/issues/210)).

## [0.15.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.14.0...0.15.0) - 2018-04-07

### Added
- `EventDeserializer.CompatibilityMode.INVALID_DATE_AND_TIME_AS_NEGATIVE_ONE` ([#210](https://github.com/shyiko/mysql-binlog-connector-java/issues/210)).

## [0.14.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.13.0...0.14.0) - 2018-04-04

### Added
- `EventDeserializer.CompatibilityMode.INVALID_DATE_AND_TIME_AS_ZERO` ([#210](https://github.com/shyiko/mysql-binlog-connector-java/issues/210)).

## [0.13.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.12.2...0.13.0) - 2017-06-04

### Changed
- GtidSet to be more flexible when it comes down to UUIDSet|s manipulations ([171](https://github.com/shyiko/mysql-binlog-connector-java/issues/171)).

## [0.12.2](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.12.1...0.12.2) - 2017-05-18

### Fixed
- Deserialization of JSON objects that contain empty keys ([170](https://github.com/shyiko/mysql-binlog-connector-java/issues/170)).

## [0.12.1](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.12.0...0.12.1) - 2017-05-10

### Fixed
- List of event types (TRANSACTION_CONTEXT was missing) ([167](https://github.com/shyiko/mysql-binlog-connector-java/issues/167)).

## [0.12.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.11.0...0.12.0) - 2017-03-31

### Added
- PREVIOUS_GTIDS deserializer ([159](https://github.com/shyiko/mysql-binlog-connector-java/pull/159)).

## [0.11.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.10.1...0.11.0) - 2017-03-02

### Added
- `BinaryLogClient::gtidSetFallbackToPurged` ([156](https://github.com/shyiko/mysql-binlog-connector-java/issues/156)).

## [0.10.1](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.10.0...0.10.1) - 2017-02-28

### Fixed
- HEARTBEAT tracking ([118](https://github.com/shyiko/mysql-binlog-connector-java/issues/118#issuecomment-283138143)).

## [0.10.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.9.2...0.10.0) - 2017-02-28

### Added
- `BinaryLogClient::heartbeatInterval` ([118](https://github.com/shyiko/mysql-binlog-connector-java/issues/118)).
NOTE: While it's 0 (disabled) by default it's RECOMMENDED that you turn it on (regardless whether you use built-in
keepAlive mechanism or not).

### Changed
- `BinaryLogClient::connectTimeout` scope (connection will now be forcefully terminated if `LifecycleListener::onConnect`
isn't reached within `BinaryLogClient::connectTimeout` from `BinaryLogClient::connect`).

## [0.9.2](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.9.1...0.9.2) - 2017-02-25

### Fixed
- `BinaryLogClient` hangs while trying to connect ([154](https://github.com/shyiko/mysql-binlog-connector-java/issues/154)).

## [0.9.1](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.9.0...0.9.1) - 2017-02-21

### Fixed

- NPE in case of EOF (BinaryLogClient) ([153](https://github.com/shyiko/mysql-binlog-connector-java/pull/153)).

## [0.9.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.8.1...0.9.0) - 2017-02-07

### Added

- `BinaryLogClient::connectTimeout` (3 seconds by default).
NOTE: `BinaryLogClient::keepAliveConnectTimeout` has been deprecated and is going to be removed in 1.0.0.

## [0.8.1](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.8.0...0.8.1) - 2016-01-10

### Fixed

- ArrayIndexOutOfBoundsException while parsing JSON ([145](https://github.com/shyiko/mysql-binlog-connector-java/issues/145)).
- `ArrayIndexOutOfBoundsException` while parsing JSON ([145](https://github.com/shyiko/mysql-binlog-connector-java/issues/145)).

## [0.8.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.7.4...0.8.0) - 2016-01-04

Expand Down Expand Up @@ -48,7 +169,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [0.6.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.5.2...0.6.0) - 2016-11-27

### Added
- EventDeserializer compatibility modes to mimic upcoming 1.0.0 event deserialization behavior ([#131](https://github.com/shyiko/mysql-binlog-connector-java/pull/131)).
- `EventDeserializer` compatibility modes to mimic upcoming 1.0.0 event deserialization behavior ([#131](https://github.com/shyiko/mysql-binlog-connector-java/pull/131)).

## [0.5.2](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.5.1...0.5.2) - 2016-11-19

Expand All @@ -60,7 +181,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- ROWS_QUERY event deserialization ([#124](https://github.com/shyiko/mysql-binlog-connector-java/issues/124)).
- JSON length determination.
- GTID sync (GtidSet is now updated before BinaryLogClient.EventListener|s are notified).
- GTID sync (`GtidSet` is now updated before `BinaryLogClient.EventListener`|s are notified).

## [0.5.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.4.2...0.5.0) - 2016-10-06

Expand Down Expand Up @@ -115,7 +236,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [0.2.4](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.2.3...0.2.4) - 2015-09-09

### Fixed
- Possible infinite loop in case of EOF in the middle of ByteArrayInputStream::fill.
- Possible infinite loop in case of EOF in the middle of `ByteArrayInputStream::fill`.

## [0.2.3](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.2.2...0.2.3) - 2015-08-31

Expand All @@ -135,7 +256,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Fixed
- Initial handshake error reporting (so that actual message received from the server wouldn't be lost).
- Risk of BinaryLogClient getting stuck while in "pre-close" state.
- Risk of `BinaryLogClient` getting stuck while in "pre-close" state.

## [0.2.0](https://github.com/shyiko/mysql-binlog-connector-java/compare/0.1.3...0.2.0) - 2015-05-01
### Added
Expand Down
21 changes: 18 additions & 3 deletions readme.md → README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# mysql-binlog-connector-java [![Build Status](https://travis-ci.org/shyiko/mysql-binlog-connector-java.svg?branch=master)](https://travis-ci.org/shyiko/mysql-binlog-connector-java) [![Coverage Status](https://coveralls.io/repos/shyiko/mysql-binlog-connector-java/badge.svg?branch=master)](https://coveralls.io/r/shyiko/mysql-binlog-connector-java?branch=master) [![Maven Central](http://img.shields.io/badge/maven_central-0.8.1-blue.svg?style=flat)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.shyiko%22%20AND%20a%3A%22mysql-binlog-connector-java%22)
# mysql-binlog-connector-java [![Build Status](https://travis-ci.org/shyiko/mysql-binlog-connector-java.svg?branch=master)](https://travis-ci.org/shyiko/mysql-binlog-connector-java) [![Coverage Status](https://coveralls.io/repos/shyiko/mysql-binlog-connector-java/badge.svg?branch=master)](https://coveralls.io/r/shyiko/mysql-binlog-connector-java?branch=master) [![Maven Central](https://img.shields.io/maven-central/v/com.github.shyiko/mysql-binlog-connector-java.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.shyiko%22%20AND%20a%3A%22mysql-binlog-connector-java%22)

MySQL Binary Log connector.

Expand Down Expand Up @@ -28,15 +28,20 @@ Get the latest JAR(s) from [here](http://search.maven.org/#search%7Cga%7C1%7Cg%3
<dependency>
<groupId>com.github.shyiko</groupId>
<artifactId>mysql-binlog-connector-java</artifactId>
<version>0.8.1</version>
<version>0.18.1</version>
</dependency>
```

#### Reading binary log file

```java
File binlogFile = ...
BinaryLogFileReader reader = new BinaryLogFileReader(binlogFile);
EventDeserializer eventDeserializer = new EventDeserializer();
eventDeserializer.setCompatibilityMode(
EventDeserializer.CompatibilityMode.DATE_AND_TIME_AS_LONG,
EventDeserializer.CompatibilityMode.CHAR_AND_BINARY_AS_BYTE_ARRAY
);
BinaryLogFileReader reader = new BinaryLogFileReader(binlogFile, eventDeserializer);
try {
for (Event event; (event = reader.readEvent()) != null; ) {
...
Expand All @@ -52,6 +57,12 @@ try {
```java
BinaryLogClient client = new BinaryLogClient("hostname", 3306, "username", "password");
EventDeserializer eventDeserializer = new EventDeserializer();
eventDeserializer.setCompatibilityMode(
EventDeserializer.CompatibilityMode.DATE_AND_TIME_AS_LONG,
EventDeserializer.CompatibilityMode.CHAR_AND_BINARY_AS_BYTE_ARRAY
);
client.setEventDeserializer(eventDeserializer);
client.registerEventListener(new EventListener() {

@Override
Expand All @@ -62,6 +73,8 @@ client.registerEventListener(new EventListener() {
client.connect();
```

> You can register a listener for `onConnect` / `onCommunicationFailure` / `onEventDeserializationFailure` / `onDisconnect` using `client.registerLifecycleListener(...)`.
> By default, BinaryLogClient starts from the current (at the time of connect) master binlog position. If you wish to
kick off from a specific filename or position, use `client.setBinlogFilename(filename)` + `client.setBinlogPosition(position)`.

Expand Down Expand Up @@ -181,6 +194,7 @@ For the insight into the internals of MySQL look [here](https://dev.mysql.com/do
## Real-world applications

Some of the OSS using / built on top of mysql-binlog-conector-java:
* [apache/nifi](https://github.com/apache/nifi) An easy to use, powerful, and reliable system to process and distribute data.
* [debezium](https://github.com/debezium/debezium) A low latency data streaming platform for change data capture (CDC).
* [mavenlink/changestream](https://github.com/mavenlink/changestream) - A stream of changes for MySQL built on Akka.
* [mardambey/mypipe](https://github.com/mardambey/mypipe) MySQL binary log consumer with the ability to act on changed rows and publish changes to different systems with emphasis on Apache Kafka.
Expand All @@ -190,6 +204,7 @@ Some of the OSS using / built on top of mysql-binlog-conector-java:
* [streamsets/datacollector](https://github.com/streamsets/datacollector) Continuous big data ingestion infrastructure.
* [twingly/ecco](https://github.com/twingly/ecco) MySQL replication binlog parser in JRuby.
* [zendesk/maxwell](https://github.com/zendesk/maxwell) A MySQL-to-JSON Kafka producer.
* [zzt93/syncer](https://github.com/zzt93/syncer) A tool sync & manipulate data from MySQL/MongoDB to ES/Kafka/MySQL, which make 'Eventual Consistency' promise.

It's also used [on a large scale](https://twitter.com/atwinmutt/status/626816601078300672) in MailChimp. You can read about it [here](http://devs.mailchimp.com/blog/powering-mailchimp-pro-reporting/).

Expand Down
Loading

0 comments on commit 7124322

Please sign in to comment.