cameronlee314 commented on a change in pull request #951: SAMZA-2127: Upgrade 
to Kafka 2.0
URL: https://github.com/apache/samza/pull/951#discussion_r268902437
 
 

 ##########
 File path: 
samza-test/src/test/java/org/apache/samza/test/framework/StreamApplicationIntegrationTestHarness.java
 ##########
 @@ -229,18 +232,32 @@ public Config getConfig() {
   }
 
   @Override
-  protected KafkaProducer createProducer() {
-    Properties kafkaConfig = new Properties();
-    kafkaConfig.setProperty("bootstrap.servers", bootstrapServers());
-    return new KafkaProducer<>(kafkaConfig, STRING_SERIALIZER, 
STRING_SERIALIZER);
+  protected Properties createProducerConfigs() {
+    Properties producerProps = new Properties();
+    producerProps.setProperty(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, 
bootstrapServers());
+    /*
+     * Stream application tests uses string serde for both key and value.
+     * The default serde for the test producer in IntegrationTestHarness uses
+     * byte serde for value and string for key.
+     */
+    producerProps.setProperty(KEY_SERIALIZER_CLASS_CONFIG, STRING_SERIALIZER);
 
 Review comment:
   Could you implement this by calling `super.createProducerConfigs`, and then 
just override the serializers? Same for `createConsumerConfigs`.

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


With regards,
Apache Git Services

Reply via email to