apache / apache/pulsar-client-go

`NewProtoSchema` is initialized as AvroSchema

Open
#739 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
745
Forks
389
Avg merge
3d 20h
Merged PRs (30d)
3

Description

#### Expected behavior

When using `NewProtoSchema` a protobuf schema for the schema registry in pulsar is expected.
Besides that, what is here the desired format in the registry when schema type is `PROTOBUF` ?

#### Actual behavior

When using `NewProtoSchema`

https://github.com/apache/pulsar-client-go/blob/128d8ea3e24035a49fc81a516b01bc57b654a64a/pulsar/schema.go#L129

its initialized as avro schema under the hood and given schema is expected to be in an avro format.

Therefore the PROTOBUF schema type is kind of pointless at the moment and the Avro schema type could be used instead?

#### Steps to reproduce

```
producer, err := client.CreateProducer(pulsar.ProducerOptions{
Topic: "test",
Schema: pulsar.NewProtoSchema(schema, nil)
})
```

`schema` is expected to have an avro format.

#### System configuration
**Pulsar version**: 2.9.1

Contributor guide

Open the contributing guide

Research direction

Start at pulsar/schema.go#L129 and trace how NewProtoSchema initializes and encodes the supplied schema. Run the producer reproduction against the Pulsar schema registry, then verify that PROTOBUF no longer treats the input as Avro and that the registry receives the expected protobuf representation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.