kafka-connect-jdbc
kafka-connect-jdbc copied to clipboard
set the offset manually
Hi:
I have updated the JdbcSourceConnectorConfig and JdbcSourceTask class to parse the offset from parameter.
Now I can set the offset manually, I have an existing table about 20GB data, Using incrementing mode, but when I start the JDBC connector will copy the history data it takes a lot of time.
So I have updated the code, I believe some people have the same problem.
usage:
{
"name": "mysql-sink-demo2",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"tasks.max": "2",
"connection.url":"jdbc:mysql://xx.xx.xx.xx:xx/demo?user=root&password=xxxxx",
"table.whitelist": "kafka_demo02",
"mode":"incrementing",
"incrementing.offset": 10000003, //or "timestamp.offset": 1000000
"incrementing.column.name":"id",
"topic.prefix":"mysql-joined-data"
}
}
incrementing.offset and timestamp.offset is optional.
thanks
It looks like @baifachuan hasn't signed our Contributor License Agreement, yet.
The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence. Wikipedia
You can read and sign our full Contributor License Agreement here.
Once you've signed reply with [clabot:check] to prove it.
Appreciation of efforts,
clabot
[clabot:check]
@confluentinc It looks like @baifachuan just signed our Contributor License Agreement. :+1:
Always at your service,
clabot
See also #429, which uses a much better approach. However, it doesn't support setting the increment, which IMO will be difficult when using multiple tables.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
fcbai seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.