sijie commented on a change in pull request #3904: [go schema] support go
schema for pulsar-client-go
URL: https://github.com/apache/pulsar/pull/3904#discussion_r275660260
##########
File path: pulsar-client-go/pulsar/client.go
##########
@@ -101,17 +101,17 @@ type ClientOptions struct {
type Client interface {
// Create the producer instance
// This method will block until the producer is created successfully
- CreateProducer(ProducerOptions) (Producer, error)
+ CreateProducer(ProducerOptions, Schema) (Producer, error)
Review comment:
> That's the same as Authentication (in both Go and Java).
I think Authentication is part of Java. so it is okay to use the same
approach as Java.
> The reason for that is how Java generics work and the interaction with
builder. We need to pass the the type <T> when the builder is created.
sure. go doesn't have generic. but having a similar interface as Java is
much better from maintenance perspective. otherwise it is really confused that
Java is having schema out side of producer/consumer configuration, but Go is
having schema as part of producer/consumer configuration.
so my take on this would make interfaces and apis as similar as possible
between different language clients. however if you really have a strong opinion
on putting schema as part of configuration, I am fine.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services