You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/06/14 15:07:47 UTC

[GitHub] [pulsar] tuteng commented on a change in pull request #4534: Support Avro schema for pulsar kafka client wrapper

tuteng commented on a change in pull request #4534: Support Avro schema for pulsar kafka client wrapper
URL: https://github.com/apache/pulsar/pull/4534#discussion_r293848969
 
 

 ##########
 File path: pulsar-client-kafka-compat/pulsar-client-kafka/src/main/java/org/apache/pulsar/client/kafka/compat/KafkaProducerInterceptorWrapper.java
 ##########
 @@ -66,9 +66,9 @@
     final private org.apache.kafka.clients.producer.ProducerInterceptor<K, V> kafkaProducerInterceptor;
 
     // For serializer key/value, and to determine the deserializer for key/value.
-    private final Serializer<K> keySerializer;
+    private final PulsarKafkaSchema<K> keySerializer;
 
 Review comment:
   As above, I understand that this KafkaProducerInterceptorWrapper  class should be specially prepared for kafka, in this class, there are several logics that will use the implementation class PulsarKafkaSchema. If defined as Schema, cast type convert is required everywhere. 
   Just like the following code:
   ```
   (PulsarKafkaSchema<K>) keySerializer.setTopic(topic);
   (PulsarKafkaSchema<K>) keySerializer.getKafkaSerializer()
   (PulsarKafkaSchema<V>) valueSerializer.setTopic(topic);
   (PulsarKafkaSchema<V>) valueSerializer.getKafkaSerializer()
   ```

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