Kafka JDBC Source Connect:从列值创建消息头

时间:2019-12-19 14:12:18

标签: jdbc apache-kafka apache-kafka-connect

我有一个微服务,该微服务使用OracleDB在EVENT_STORE表中发布系统更改。表EVENT_STORE包含列CALLBACK_RECIPIENT

JDBC Source Kafka Connect可能会进行EVENT_STORE表更改,并使用标题 of CALLBACK_RECIPIENT的值发布它们。 > kafka消息

这是我的源kafka连接器配置:

{
  "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
  "timestamp.column.name": "CREATE_AT",
  "incrementing.column.name": "ID",
  "errors.log.include.messages": "false",
  "connection.password": "",
  "tasks.max": "1",
  "transforms.RenameFields.renames": "ID:id, EVENT_ID:eventId, TRACE_ID:traceId, CORRELATION_ID:correlationId, SENDER:sender, EVENT_TYPE:eventType, AGGREGATION_TYPE:aggregationType, EVENT_USER:eventUser, VERSION:version, EVENT_DATA:eventData, PARAMETERS:parameters, RESULT_CODE:resultCode, RESULT_MESSAGE:resultMessage, RESULT_DATA:resultData, CALLBACK_RECIPIENT:callbackRecipient, TOPIC:topic, CREATE_AT:createAt,  UPDATED_AT:updatedAt",
  "transforms": "ValueFieldTopic, RenameFields, copyHeaderToValueField",
  "table.types": "TABLE",
  "table.whitelist": "EVENT_STORE",
  "mode": "timestamp+incrementing",
  "topic.prefix": "",
  "poll.interval.ms": "5000",
  "db.timezone": "UTC",
  "value.converter": "org.apache.kafka.connect.json.JsonConverter",
  "config.action.reload": "restart",
  "errors.log.enable": "false",
  "key.converter": "org.apache.kafka.connect.storage.StringConverter",
  "errors.retry.timeout": "0",
  "transforms.ValueFieldTopic.field": "TOPIC",
  "validate.non.null": "true",
  "connection.attempts": "3",
  "errors.retry.delay.max.ms": "60000",
  "batch.max.rows": "100",
  "connection.backoff.ms": "10000",
  "timestamp.delay.interval.ms": "0",
  "transforms.ValueFieldTopic.type": "io.confluent.connect.transforms.ExtractTopic$Value",
  "table.poll.interval.ms": "60000",
  "schema.ignore": "true",
  "key.converter.schemas.enable": "false",
  "transforms.RenameFields.type": "org.apache.kafka.connect.transforms.ReplaceField$Value",
  "connection.user": "",
  "value.converter.schemas.enable": "false",
  "errors.tolerance": "none",
  "connection.url": "jdbc:oracle:thin:@localhost:1521:xe",
  "numeric.precision.mapping": "false",
  "quote.sql.identifiers": "ALWAYS"
}

0 个答案:

没有答案