merlimat 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_r275632050
 
 

 ##########
 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:
   > a) if we are following Java, it is better to have schema as a separated 
argument.
   
   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. 
   That won't be the case in Go.
   
   > b) schema is not an option. it is a long-live go instance during the 
lifecycle of a producer/consumer. but options are only used during 
construction. after they are passed to cpp client's configuration, the go 
options are not used anymore.
   
   That's the same as Authentication (in both Go and Java). Passing these 
interfaces in as options makes the API less cluttered and easier to add things 
in a backward compatible way.
   
   

----------------------------------------------------------------
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

Reply via email to