lujiajing1126 opened a new issue #5507: URL: https://github.com/apache/skywalking/issues/5507
Please answer these questions before submitting your issue. - Why do you submit this issue? - [ ] Question or discussion - [x] Bug - [ ] Requirement - [ ] Feature or performance improvement ___ ### Bug - Which version of SkyWalking, OS and JRE? 8.1.0 - What happened? According to the definition in the `Kafka Client`, the type of the `bootstrap.servers` property can be either list or comma-separated string (precisely, comma with white space). See [`ConfigDef.java`](https://github.com/apache/kafka/blob/aa5263fba903c85812c0c31443f7d49ee371e9db/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java#L699-L708) and [`ProducerConfig.java`](https://github.com/apache/kafka/blob/aa5263fba903c85812c0c31443f7d49ee371e9db/clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java#L294) in the Kafka client library. But in the [`ProducerConstructorMapInterceptor`](https://github.com/apache/skywalking/blob/2ebb5bdf3af7ae52e70a2145702baa6afeeac3bb/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/ProducerConstructorMapInterceptor.java#L34), we explicitly cast `Object` to `String`, which in some causes will cause issues, for example #4652 . Due to the https://github.com/apache/kafka/pull/5781 (from Kafka 2.1), the first parameter of the main constructor has been changed to `Map`, so we have to check the type before casting here. Also by default, [`Spring Boot`](https://github.com/spring-projects/spring-boot/blob/602e62998eb2254517d695fa67246399ba40b8bf/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java#L64) defines `spring.kafka.bootstrap-servers` as `ArrayList`, which may probably lead to errors. I would like to submit a PR to fix this problem. ---------------------------------------------------------------- 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]
