My version of GoldenGate for bigdata is as follows:
Oracle GoldenGate for Big Data
Version 12.3.2.1.1 (Build 005)
Oracle GoldenGate Command Interpreter
Version 12.3.0.1.2 OGGCORE_OGGADP.12.3.0.1.2_PLATFORMS_180712.2305
Linux, x64, 64bit (optimized), Generic on Jul 13 2018 00:46:09
Operating system character set identified as UTF-8.
My kafka.props configuration:
[oggmes@server6 ogg]$ cat dirprm/kafka.props
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=${tableName}
#The following selects the message key using the concatenated primary keys
gg.handler.kafkahandler.keyMappingTemplate=${primaryKeys}
gg.handler.kafkahandler.format=json
gg.handler.kafkahandler.format.insertOpKey = I
gg.handler.kafkahandler.format.updateOpKey = U
gg.handler.kafkahandler.format.deleteOpKey = D
gg.handler.name.format.pkUpdateHandlingformat.pkUpdateHandling = delete-insert
gg.handler.kafkahandler.format.prettyPrint = true
gg.handler.kafkahandler.format.jsonDelimiter = CDATA[]
gg.handler.kafkahandler.format.schemaDirectory = dirdef
gg.handler.kafkahandler.format.includePrimaryKeys = true
gg.handler.kafkahandler.SchemaTopicName=tsmes
gg.handler.kafkahandler.BlockingSend = false
gg.handler.kafkahandler.includeTokens = true
gg.handler.kafka.topicPartitioning = table
gg.handler.kafkahandler.Mode = op
goldengate.userexit.timestamp = utc + 8
goldengate.userexit.writers=javawriter
javawriter.stats.display=TRUE
javawriter.stats.full=TRUE
gg.log=log4j
gg.log.level=INFO
gg.report.time=30sec
gg.classpath=dirprm/:/home/oggmes/kafka/libs/*
javawriter.bootoptions=-Xmx512m -Xms32m -Djava.class.path=ggjava/ggjava.jar
But when I run the replicat process, I can't get the normal JSON message.
Instead, get the following JSON message:
[oggmes@server6 ogg]$ cat dirdef/CMES.ERP_SALE_ORDER.schema.json
{
"$schema":"http://json-schema.org/draft-04/schema#",
"title":"CMES.ERP_SALE_ORDER",
"description":"JSON schema for table CMES.ERP_SALE_ORDER",
"definitions":{
"row":{
"type":"object",
"properties":{
"ID":{
"type":[
"string",
"null"
]
},
"USER_CREATED":{
"type":[
"string",
"null"
]
},
"DATETIME_CREATED":{
"type":[
"string",
"null"
]
},
"USER_MODIFIED":{
"type":[
"string",
"null"
]
},
"DATETIME_MODIFIED":{
"type":[
"string",
"null"
]
},
"STATE":{
"type":[
"string",
"null"
]
},
"ENTERPRISE_ID":{
"type":[
"string",
"null"
]
},
"ORG_ID":{
"type":[
"string",
"null"
]
},
"BILL_NO":{
"type":[
"string",
"null"
]
},
"CUSTOMER_CODE":{
"type":[
"string",
"null"
]
},
"DELIVER_ADDRESS":{
"type":[
"string",
"null"
]
},
"IS_MANUAL":{
"type":[
"string",
"null"
]
},
"REMARK":{
"type":[
"string",
"null"
]
},
"ERP_ID":{
"type":[
"string",
"null"
]
},
"STATUS":{
"type":[
"string",
"null"
]
}
},
"additionalProperties":false
},
"tokens":{
"type":"object",
"description":"Token keys and values are free form key value pairs.",
"properties":{
},
"additionalProperties":true
}
},
"type":"object",
"properties":{
"table":{
"description":"The fully qualified table name",
"type":"string"
},
"op_type":{
"description":"The operation type",
"type":"string"
},
"op_ts":{
"description":"The operation timestamp",
"type":"string"
},
"current_ts":{
"description":"The current processing timestamp",
"type":"string"
},
"pos":{
"description":"The position of the operation in the data source",
"type":"string"
},
"primary_keys":{
"description":"Array of the primary key column names.",
"type":"array",
"items":{
"type":"string"
},
"minItems":0,
"uniqueItems":true
},
"tokens":{
"$ref":"#/definitions/tokens"
},
"before":{
"$ref":"#/definitions/row"
},
"after":{
"$ref":"#/definitions/row"
}
},
"required":[
"table",
"op_type",
"op_ts",
"current_ts",
"pos"
],
"additionalProperties":false
}
Why not output the following JSON messages?
offset = 287, value =
{
"table":"CMES.ERP_SALE_ORDER",
"op_type":"U",
"op_ts":"2018-09-14 00:37:48.699888",
"current_ts":"2018-09-14T08:37:55.273000",
"pos":"00000000020000007525",
"tokens":{
},
"before":{
"ID":"3",
"USER_CREATED":"DD",
"DATETIME_CREATED":"2018-09-06:17:13:01",
"USER_MODIFIED":null,
"DATETIME_MODIFIED":null,
"STATE":"C",
"ENTERPRISE_ID":"###",
"ORG_ID":"2",
"BILL_NO":"2",
"CUSTOMER_CODE":"2",
"DELIVER_ADDRESS":null,
"IS_MANUAL":"2",
"REMARK":null,
"ERP_ID":null,
"STATUS":"ooo"
},
"after":{
"ID":"3",
"USER_CREATED":"WW",
"DATETIME_CREATED":"2018-09-06:17:13:01",
"USER_MODIFIED":null,
"DATETIME_MODIFIED":null,
"STATE":"C",
"ENTERPRISE_ID":"###",
"ORG_ID":"2",
"BILL_NO":"2",
"CUSTOMER_CODE":"2",
"DELIVER_ADDRESS":null,
"IS_MANUAL":"2",
"REMARK":null,
"ERP_ID":null,
"STATUS":"ooo"
}
}
It's been several days.
I don't know why?