an0r0c / kafka-connect-transform-tojsonstring

transform-to-json-string is a Single Message Transformation (SMT) for Apache Kafka® Connect to convert a given Connect Record to a single JSON String. It's an UNOFFICIAL community project.
Apache License 2.0
32 stars 13 forks source link

Cannot insert in DB #16

Closed 4integration closed 1 year ago

4integration commented 1 year ago

Hi,

I have this exact challenge as described in the medium article but have some issues to get it running. When testing this locally it fails with inserting to table so wonder if the data is escaped etc. I dumped the data on S3 and it look like below, can you see anything strange? Using DB2

{
    "jsonstring": "{\"messageId\": \"e9820d63-e41a-4501-a03a-4a4225d3d24f\", \"createdAt\": {\"$date\": \"2023-06-09T12:33:29.475Z\"}, \"vehicleId\": {\"registrationNumber\": \"TEST\", \"vin\": null}, \"commandType\": \"RETURNED_COMMAND\", \"command\": {\"ReturnedCommand\": {\"leaseId\": \"TEST-001\", \"requestReceived\": {\"$date\": \"2023-06-09T12:33:26.571Z\"}, \"returnDate\": {\"$date\": \"2023-06-05T00:00:00Z\"}, \"odometerKilometers\": 2500, \"carDealer\": {\"carDealerName\": \"CarCompany\", \"recipientName\": \"Mr X\", \"recipientPhoneNumber\": \"073-19191919\", \"recipientEmail\": \"mrx@mail.com\", \"address\": \"Streetgård 11\", \"postcode\": \"43111\", \"postalAddress\": \"Mölndal\"}, \"includedItems\": [\"WINTER_WHEELS\", \"SERVICE_BOOK\"], \"damages\": [], \"additionalInfo\": \"\"}, \"InspectedCommand\": null, \"SoldCommand\": null, \"PaidCommand\": null, \"DocumentsCommand\": null}}"
}