Simple¶
This example takes a simple copy book and converts the incoming string data based on it.
{
"transforms" : "fromCopybook",
"transforms.fromCopybook.type" : "com.github.jcustenborder.kafka.connect.cobol.FromCopybook$Value",
"transforms.fromCopybook.cobol.context.type" : "Ascii",
"transforms.fromCopybook.cobol.copybook" : "01 AWL-RECORD-SPAD. 05 DUMMY-SERIAL-NO-AWL PIC X(8)."
}
{
"topic" : "test",
"kafkaPartition" : 1,
"valueSchema" : {
"type" : "STRING",
"isOptional" : false
},
"value" : "ABCDEFGH",
"timestampType" : "NO_TIMESTAMP_TYPE",
"offset" : 1574310211719,
"headers" : [ ]
}
Change(s) in the output are emphasized if delta(s) are detected.
{
"topic" : "test",
"kafkaPartition" : 1,
"valueSchema" : {
"name" : "AwlRecordSpad",
"type" : "STRUCT",
"parameters" : {
"copybook.name" : "AWL-RECORD-SPAD",
"copybook.source.line" : "1"
},
"isOptional" : false,
"fieldSchemas" : {
"dummySerialNoAwl" : {
"type" : "STRING",
"parameters" : {
"copybook.field.level.number" : "5",
"copybook.field.name" : "DUMMY-SERIAL-NO-AWL",
"copybook.source.line" : "1",
"copybook.field.length" : "8"
},
"isOptional" : true
}
}
},
"value" : {
"schema" : {
"name" : "AwlRecordSpad",
"type" : "STRUCT",
"parameters" : {
"copybook.name" : "AWL-RECORD-SPAD",
"copybook.source.line" : "1"
},
"isOptional" : false,
"fieldSchemas" : {
"dummySerialNoAwl" : {
"type" : "STRING",
"parameters" : {
"copybook.field.level.number" : "5",
"copybook.field.name" : "DUMMY-SERIAL-NO-AWL",
"copybook.source.line" : "1",
"copybook.field.length" : "8"
},
"isOptional" : true
}
}
},
"fieldValues" : [ {
"name" : "dummySerialNoAwl",
"schema" : {
"type" : "STRING",
"parameters" : {
"copybook.field.level.number" : "5",
"copybook.field.name" : "DUMMY-SERIAL-NO-AWL",
"copybook.source.line" : "1",
"copybook.field.length" : "8"
},
"isOptional" : true
},
"storage" : "ABCDEFGH"
} ]
},
"timestampType" : "NO_TIMESTAMP_TYPE",
"offset" : 1574310211719,
"headers" : [ ]
}