Add pause and resume snapshot signals. See previous commit for more
details. These signal do the same, but are used by read-only MySQL
where sending signals is done by sending Kafka messages.
In the follow-up commit signal for pause and resume snapshot will be
added. Intorduce `KafkaSignal` interface which would server as general
kafka-based signal.
Add two JXM objects:
* `snapshotPaused` - detemines if the incremental snapshot is paused
or not
* `snapshotPausedDurationInSeconds` - overall time when the incremental
snapshot was paused. The time adds up - if the snapshot was paused
e.g. two times, the `snapshotPausedDurationInSeconds` is the sum of
these two paused times.
Intorduce two new signals:
* `pause-snapshot` - pauses running incremental snapshot
* `resume-snapshot` - resumes paused incremental snapshot
If the incremental snapshot is running and pause signal is sent,
currently processed chunk is finished and then no other chunk is read.
Snapshot state is kept in running state. Once snapshot is resume,
chunk is reverted to position which was last sent to the broker and
process of reading chunks and emitting `read` events continues until
all tables are read and sent.
This patch handles only table-based signals. MySQL Kafka-based signals
will be addressed later.
In existing test we added all events in the loop which can lead into
adding one event multiple times and therefore failing the tests.
When test run alone, this probably never happen or it was very rare.
Now, when test runs with Debezium server already running, it fails more
often. Fix it by removing already added events from WireMock.
If sending record to HTTP consumer fails, retry sending couple of times
and fail eventually. Retrying immdiatelly usually have no effect,
therefore sleep some time between retries.
Intorduce new config option to `HttpChangeConsumer`:
* `retries` - number of retries before exception is throws
* `retry.interval.ms` - amount of time to sleep before next retry
Normally WireMock is reset after each test. However, as we run WireMock
as a container, it's not reset and we have to do so manully. Add
a method which resets WireMock by sending HTTP request.