pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [pulsar] sijie commented on a change in pull request #3904: [go schema] support go schema for pulsar-client-go
Date Sat, 13 Apr 2019 20:42:50 GMT
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_r275130811
 
 

 ##########
 File path: pulsar-client-go/pulsar/c_consumer.go
 ##########
 @@ -109,6 +112,24 @@ func subscribeAsync(client *client, options ConsumerOptions, callback
func(Consu
 		C.pulsar_consumer_set_subscription_initial_position(conf, C.initial_position(options.SubscriptionInitPos))
 	}
 
+	if schema != nil {
+		if schema.GetSchemaInfo().Type != NONE {
+			cName := C.CString(schema.GetSchemaInfo().Name)
+			cSchema := C.CString(schema.GetSchemaInfo().Schema)
+			defer C.free(unsafe.Pointer(cName))
+			defer C.free(unsafe.Pointer(cSchema))
+			C.pulsar_consumer_configuration_set_schema_type(conf, C.pulsar_schema_type(schema.GetSchemaInfo().Type),
 
 Review comment:
   following the comment I had above, if you have a method `pulsar_consumer_configuration_set_schema_info`,
you can just convert a go `SchemaInfo` to a cpp `SchemaInfo`, correct? In this way, the properties
will not be lost. Also in future, if we introduce new fields to `SchemaInfo`, they can be
handled correctly in one place, without touching producer and consumer configuration in cpp
again.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message