Skip to content

Replace schema registry TODO with explicit redirect in ProtoBufMessageDecoder#18818

Open
lazyfetch wants to merge 2 commits into
apache:masterfrom
lazyfetch:fix/protobuf-decoder-schema-registry-todo
Open

Replace schema registry TODO with explicit redirect in ProtoBufMessageDecoder#18818
lazyfetch wants to merge 2 commits into
apache:masterfrom
lazyfetch:fix/protobuf-decoder-schema-registry-todo

Conversation

@lazyfetch

Copy link
Copy Markdown

What changed and why

Closes #18221

ProtoBufMessageDecoder has carried a class-level TODO: Add support for Schema Registry
since it was introduced. After reviewing the existing decoder landscape:

  • KafkaConfluentSchemaRegistryProtoBufMessageDecoder already fully implements
    Confluent Schema Registry-backed descriptor resolution
  • ProtoBufMessageDecoder is intentionally file-based and stream-format-agnostic;
    adding registry support here would either duplicate that logic or introduce a
    Confluent dependency where there is none today

This PR takes the explicit redirect path listed in the issue scope:

  • Replaces the TODO with a comment explaining the design boundary
  • Improves the error message when descriptorFile is missing to explicitly
    point users to KafkaConfluentSchemaRegistryProtoBufMessageDecoder

Testing

Added a test to ProtoBufMessageDecoderTest verifying that initialising the
decoder without descriptorFile throws an IllegalStateException whose message
references both the missing property name and the registry-backed decoder class.

@codecov-commenter

codecov-commenter commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.75%. Comparing base (ff7df48) to head (9a20cc4).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #18818   +/-   ##
=========================================
  Coverage     64.75%   64.75%           
  Complexity     1319     1319           
=========================================
  Files          3391     3391           
  Lines        210891   210891           
  Branches      33105    33105           
=========================================
+ Hits         136552   136557    +5     
- Misses        63320    63321    +1     
+ Partials      11019    11013    -6     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-21 64.75% <100.00%> (+<0.01%) ⬆️
temurin 64.75% <100.00%> (+<0.01%) ⬆️
unittests 64.74% <100.00%> (+<0.01%) ⬆️
unittests1 56.94% <ø> (-0.01%) ⬇️
unittests2 37.17% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

_protoClassName = props.getOrDefault(PROTO_CLASS_NAME, "");
InputStream descriptorFileInputStream = ProtoBufUtils.getDescriptorFileInputStream(
props.get(DESCRIPTOR_FILE_PATH));
props.get(DESCRIPTOR_FILE_PATH));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation is wrong

@Override
public void init(Map<String, String> props, Set<String> fieldsToRead, String topicName)
throws Exception {
throws Exception {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation is wrong

}

@Test
public void testInitThrowsHelpfulMessageWhenDescriptorFileMissing() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no point to add test for this

//TODO: Add support for Schema Registry
// This decoder is intentionally file-based and does not support schema registry.
// For Confluent Schema Registry-backed descriptor resolution, use
// KafkaConfluentSchemaRegistryProtoBufMessageDecoder instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use markdown style and the comments should start with ///

@lazyfetch lazyfetch requested a review from xiangfu0 June 22, 2026 22:32
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.

Add schema registry support to ProtoBufMessageDecoder

3 participants