如何使用kafka connect将kafka主题下沉到oracle?

2021-11-12 00:00:00 oracle apache-kafka-connect

我有一个包含数据的 kafka 主题,以下是我用来将数据接收到 oracle 的配置文件.

I have a kafka topic with data, following is config file I am using to sink data to oracle.

Sink.properties

Sink.properties

name=ora_sink_task
connector.class=io.confluent.connect.jdbc.JdbcSinkConnector
tasks.max=1
topics=person
connection.url=jdbc:oracle:thin:@127.0.0.1:1521/XE
connection.user=kafka
connection.password=kafka
auto.create=true
insert.mode=upsert
pk.mode=record_value
pk.fields=id

我在日志中收到以下响应.

I am getting following response in logs.

[2017-06-06 21:09:33,557] DEBUG Scavenging sessions at 1496504373557 (org.eclipse.jetty.server.session:347)
[2017-06-06 21:10:03,557] DEBUG Scavenging sessions at 1496504403557 (org.eclipse.jetty.server.session:347)
[2017-06-06 21:10:33,558] DEBUG Scavenging sessions at 1496504433558 (org.eclipse.jetty.server.session:347)

但是在oracle中没有创建表.

But no table is created in oracle.

推荐答案

在 Kafka 中将主题名称更改为 PERSON 并且在 Sink.properties 中将主题名称更改为 PERSON 后,它起作用了.

After changing topic name to PERSON in Kafka and topics=PERSON in Sink.properties it worked.

相关文章