{"id":27245175,"url":"https://github.com/baunz/struct-converters","last_synced_at":"2026-02-12T22:33:48.853Z","repository":{"id":52203898,"uuid":"343506715","full_name":"baunz/struct-converters","owner":"baunz","description":"kafka-connect converter for ingesting raw data into a JDBC sink","archived":false,"fork":false,"pushed_at":"2025-01-17T10:18:18.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T21:09:28.778Z","etag":null,"topics":["connector","json","json-records","kafka-connect"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baunz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-01T17:50:52.000Z","updated_at":"2025-01-17T10:14:54.000Z","dependencies_parsed_at":"2025-04-10T21:09:34.165Z","dependency_job_id":"b02521e1-f6e1-4d2c-b568-96e49af44b5f","html_url":"https://github.com/baunz/struct-converters","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/baunz/struct-converters","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baunz%2Fstruct-converters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baunz%2Fstruct-converters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baunz%2Fstruct-converters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baunz%2Fstruct-converters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baunz","download_url":"https://codeload.github.com/baunz/struct-converters/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baunz%2Fstruct-converters/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29383981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T22:07:52.078Z","status":"ssl_error","status_checked_at":"2026-02-12T22:07:49.026Z","response_time":55,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["connector","json","json-records","kafka-connect"],"created_at":"2025-04-10T21:09:26.804Z","updated_at":"2026-02-12T22:33:48.838Z","avatar_url":"https://github.com/baunz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# struct-converters\n\nConvert schemaless, primitive kafka messages into ConnectData\n\n## Why?\n\nMost sink connectors in kafka-connect require a schema to insert the data. When dealing with topics that contain plain JSON records it's not possible to insert them them without an inline schema, as explained [here](https://www.confluent.de/blog/kafka-connect-deep-dive-converters-serialization-explained/#string-json-data)\n\nSometimes it is just not possible to change the JSON records to include the schema and we are okay with having the json \"as-is\" in the sink system. This still allows a \"schema-on-read\"-strategy, supported by RDBMS like MySql and Postgres with their JSON data types.\n \n See [Further options](#further-options)\n ## Installation\n \n Copy a release jar from this website into your [connect plugin path](https://docs.confluent.io/home/connect/userguide.html#installing-kconnect-plugins)\n \n ## Configuration\n \nGiven this example json\n \n ```\nrecord-key: 456\nrecord-value: {\n   \"id\" : \"11eb50e4-e3b5-f40f-b709-36bc5ee27958\",\n   \"shopId\" : 2001,\n   \"origin\" : \"space\",\n   \"type\" : \"like\",\n   \"createDate\" : \"2021-01-12T13:34:16.653Z\",\n   \"payload\" : {\n     \"profileId\" : \"11eb50e4-e3b5-f40f-b709-36bc5ee27958\",\n    }\n}\n ```\n\nand the following table created in the sink db\n\n```\ncreate table `super_event` (\n  `ID` VARCHAR(255) NOT NULL,\n  `VALUE` JSON,\n   PRIMARY KEY (ID)\n) ENGINE = InnoDB\n```\n\nThe following connector configuration \n \n ```\nconnector.class=io.confluent.connect.jdbc.JdbcSinkConnector\ntopics=super_event\nkey.converter=org.apache.kafka.connect.storage.StringConverter\nvalue.converter=com.github.baunz.kafka.connect.storage.StringAsStructConverter\nconnection.url=jdbc=mysql=//awesome-db/\ninsert.mode=UPSERT\npk.mode=record_key\npk.fields=id\n```\n\ncreates a connector that fills the target table and allows the data to be queried like this (mysql example)\n\n\n```\nselect\n  value-\u003e\u003e'$.key',\n  value-\u003e\u003e'$.payload.profileId'\nfrom\n  super_event;\n```\n ## Further Options\n \n * Apply a schema to the raw JSON to via transforms (https://jcustenborder.github.io/kafka-connect-documentation/projects/kafka-connect-json-schema/transformations/FromJson.html)\n \n * Attach a schema with KSQL (https://rmoff.net/2020/01/22/kafka-connect-and-schemas/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaunz%2Fstruct-converters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaunz%2Fstruct-converters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaunz%2Fstruct-converters/lists"}