Skip to content

Conversation

@sbhuiyan-buf
Copy link

This commit adds support for deserializing protobuf messages that use plain protobuf payloads but use Buf Schema Registry (BSR). Unlike Confluent Schema Registry which embeds schema information in the message payload, BSR stores schema metadata in Kafka record headers.

The BSR wire format uses two headers to identify the schema:

  • buf.registry.value.schema.message: The fully-qualified message type
  • buf.registry.value.schema.commit: The schema version/commit hash

The implementation includes:

Backend Changes:

  • New BSRClient interface and HTTP client for fetching schemas from BSR
  • ProtobufBSRSerde for deserializing BSR-encoded messages
  • Configuration support for BSR endpoint URL and authentication token
  • Integration with existing serde service to automatically detect BSR messages
  • Comprehensive unit and integration tests

Frontend Changes:

  • Added PAYLOAD_ENCODING_PROTOBUF_BSR enum value
  • Updated message preview components to display BSR encoding
  • Extended proto definitions and TypeScript interfaces

The BSR serde is prioritized before other protobuf serdes in the deserialization pipeline since BSR messages are identifiable by their specific headers, allowing for efficient format detection.

All existing tests pass and new tests verify BSR deserialization works correctly with dynamic protobuf messages.

This commit adds support for deserializing protobuf messages that
use plain protobuf payloads but use Buf Schema Registry (BSR). Unlike Confluent Schema
Registry which embeds schema information in the message payload,
BSR stores schema metadata in Kafka record headers.

The BSR wire format uses two headers to identify the schema:
- buf.registry.value.schema.message: The fully-qualified message type
- buf.registry.value.schema.commit: The schema version/commit hash

The implementation includes:

Backend Changes:
- New BSRClient interface and HTTP client for fetching schemas from BSR
- ProtobufBSRSerde for deserializing BSR-encoded messages
- Configuration support for BSR endpoint URL and authentication token
- Integration with existing serde service to automatically detect BSR messages
- Comprehensive unit and integration tests

Frontend Changes:
- Added PAYLOAD_ENCODING_PROTOBUF_BSR enum value
- Updated message preview components to display BSR encoding
- Extended proto definitions and TypeScript interfaces

The BSR serde is prioritized before other protobuf serdes in the
deserialization pipeline since BSR messages are identifiable by their
specific headers, allowing for efficient format detection.

All existing tests pass and new tests verify BSR deserialization
works correctly with dynamic protobuf messages.
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