I try to create a source Kafka connect with timestamp mode in Windows. I have this table:
CREATE TABLE "usu"."mytable" (
"first_name" CHAR(8 BYTE) DEFAULT ' ',
"last_name" CHAR(8 BYTE) DEFAULT ' ',
"regist" TIMESTAMP (0) DEFAULT SYS_EXTRACT_UTC(SYSTIMESTAMP)
) TABLESPACE "temp" ;
oracle database properties:
name=jdbc-conector
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
connection.url=jdbc:oracle:thin:@localhost:1521:xe
connection.user=usu
connection.password=pwd
query=select NDZ, to_timestamp(STRING_TIMESTAMP,'YYYY - MM - DD HH: MI: SS, FF6') AS TIMESTAMP_COLUMN FROM myTable
mode=timestamp+incrementing
timestamp.column.name=TIMESTAMP_COLUMN
incrementing.column.name=NDZ
db.timezone=UTC
dialect.name=OracleDatabaseDialect
numeric.mapping=best_fit
table.types=TABLE
poll.interval.ms=1000
topic.prefix=input-mytable
INSERT INTO "usu"."mytable" (first_name,last_name) values("jake","tyler");
select output:
jake tyler 2019-08-23 11:54:47:046
The console-consumer does not return any output:
kafka-console-consumer --bootstrap-server localhost:9092 --topic input-mytable
Connector only working in bulk mode. I do not understand why.
checking connector:
curl localhost:8083/connectors/jdbc-conector/status/
{"name":"jdbc-conector","connector":
{"state":"RUNNING","worker_id":"1.2.3.4:8083"},"tasks":
[{"id":0,"state":"RUNNING","worker_id":"1.2.3.4:8083"}],"type":"source"}
Ed: In debug mode, my output is like this.
source kafka connect:
D:\kafka\bin\windows\connect-standalone.bat D:\kafka\config\connect-standalone.properties D:\kafka\config\connect-bbdd.properties
output:
DEBUG: prepared SQL query: 'select NDZ, to_timestamp(STRING_TIMESTAMP,'YYYY - MM - DD HH: MI: SS, FF6') AS TIMESTAMP_COLUMN FROM myTable) WHERE "TIMESTAMP_COLUMN" < ? AND(("TIMESTAMP_COLUMN" = ? AND "NDZ" > ? ) OR "TIMESTAMP_COLUMN" > ? ) ORDER BY "TIMESTAMP_COLUMN", "NDZ" ASC.
[2019-08-23 14:01:36,150] DEBUG Executing prepared statement with start time value = 2019-08-23 11:40:47:046 end time = 2019-08-23 11:40:47:046 and incrementing value = 19 (io.confluent.connect.jdbc.source.TimestampIncrementingCriteria)
How can i controlled time difference?