适用于Kafka的Oracle GoldenGate适配器 - JSON消息内容

时间:2018-03-17 14:09:44

标签: apache-kafka oracle-golden-gate

在我的金门大数据中为卡夫卡。当我尝试更新记录时,只获取json文件中的部分后更新列和主键列

{"table":"MYSCHEMATOPIC.PASSPORTS","op_type":"U","op_ts":"2018-03-17 13:57:50.000000","current_ts":"2018-03-17T13:57:53.901000","pos":"00000000030000010627","before":{"PASSPORT_ID":71541893,"PPS_ID":71541892,"PASSPORT_NO":"1234567","PASSPORT_NO_NUMERIC":241742,"PASSPORT_TYPE_ID":7,"ISSUE_DATE":null,"EXPIRY_DATE":"0060-12-21 00:00:00","ISSUE_PLACE_EN":"UN-DEFINED","ISSUE_PLACE_AR":"?????? ????????","ISSUE_COUNTRY_ID":203,"ISSUE_GOV_COUNTRY_ID":203,"IS_ACTIVE":1,"PREV_PASSPORT_ID":null,"CREATED_DATE":"2003-06-08 00:00:00","CREATED_BY":-9,"MODIFIED_DATE":null,"MODIFIED_BY":null,"IS_SETTLED":0,"MAIN_PASSPORT_PERSON_INFO_ID":34834317,"NATIONALITY_ID":590},
"after":{"PASSPORT_ID":71541893,"NATIONALITY_ID":589}}

在我的json中的部分后,我想显示所有列

如何获取部分后的所有列?

gg.handlerlist = kafkahandler
gg.handler.kafkahandler.type=kafka gg.handler.kafkahandler.KafkaProducerConfigFile=custom_kafka_producer.properties
    #The following resolves the topic name using the short table name
    gg.handler.kafkahandler.topicMappingTemplate=passports

    gg.handler.kafkahandler.format=json
    gg.handler.kafkahandler.BlockingSend =false
    gg.handler.kafkahandler.includeTokens=false
    gg.handler.kafkahandler.mode=op
    #gg.handler.kafkahandler.format.insertOpKey=I
    #gg.handler.kafkahandler.format.updateOpKey=U
    #gg.handler.kafkahandler.format.deleteOpKey=D
    #gg.handler.kafkahandler.format.truncateOpKey=T
    #gg.handler.kafkahandler.format.includeColumnNames=TRUE
    goldengate.userexit.timestamp=utc
    goldengate.userexit.writers=javawriter
    javawriter.stats.display=TRUE
    javawriter.stats.full=TRUE
    gg.log=log4j
    gg.log.level=info
  gg.report.time=30sec

2 个答案:

答案 0 :(得分:0)

请尝试使用Kafka Connect handler - 这包括完整的有效负载。 This article完成设置过程。

答案 1 :(得分:0)

您好,此问题已通过在金门大桥一侧添加以下更改得到解决

ADD TRANDATA table_name ALLCOLS