You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/09/17 09:07:01 UTC

[GitHub] [skywalking] wu-sheng commented on a change in pull request #5510: Check bootstrapServers type before casting for kafka-clients >= 2.1

wu-sheng commented on a change in pull request #5510:
URL: https://github.com/apache/skywalking/pull/5510#discussion_r490089552



##########
File path: test/plugin/scenarios/spring-kafka-2.3.x-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/spring/kafka/controller/CaseController.java
##########
@@ -82,6 +85,21 @@ private void setUpProvider() {
         }
     }
 
+    private void setUpAnotherProvider() {
+        Map<String, Object> props = new HashMap<>();
+        // use list type here
+        props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, Arrays.asList(bootstrapServers.split(",")));
+        props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
+        props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
+        kafkaTemplate2 = new KafkaTemplate<String, String>(new DefaultKafkaProducerFactory<>(props));
+        try {
+            kafkaTemplate2.send(topicName, "key", "ping").get();
+            kafkaTemplate2.flush();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+

Review comment:
       Once you changed this, you should change the expected data yaml to map this.




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