Skip to content

[DOCS-39462]-Use Schema Registry in the README producer example - #2324

Open
Jamie Gillenwater (jgillenwater) wants to merge 2 commits into
masterfrom
DOCS-39462
Open

Jamie Gillenwater (jgillenwater) wants to merge 2 commits into
masterfrom
DOCS-39462

Conversation

@jgillenwater

Copy link
Copy Markdown
Member

Summary

  • Change the README's first producer example from producing a raw UTF-8 string to producing through a Schema Registry JSONSerializer.
  • Add a StringSerializer for the key and a SerializationContext for the value, matching the pattern in examples/json_producer.py.
  • Add a trailer noting the confluent-kafka[json,schemaregistry] extra, and linking to the Schema Registry Integration section and the fuller examples/json_producer.py.

Addresses DOCS-39462: the first example a developer copies sets the default. Producing raw bytes leads to data-quality issues, broken consumers, and ungovernable data, so the README's first-run example should use Schema Registry. This is one of five coordinated PRs across librdkafka, confluent-kafka-python, confluent-kafka-go, confluent-kafka-dotnet, and confluent-kafka-javascript.

Verification

  • Example verified by an SME against a local broker and Schema Registry.
  • Snippet extracted from the rendered README and checked with py_compile.

Replace the raw-bytes first producer example in the README with a
JSONSerializer-based one, so the first example a reader copies registers
and validates a schema instead of producing unstructured bytes.

Points to the JSON Schema pip extra, the Schema Registry Integration
section, and examples/json_producer.py for a fuller runnable version.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Apply the repo's black config (line-length 120, skip-string-normalization)
to the basic producer example: two blank lines around delivery_report and
a reflowed docstring. No functional change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sonarqube-confluent

Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant