jmjoy opened a new pull request, #70: URL: https://github.com/apache/skywalking-rust/pull/70
This pull request refactors the Kafka client configuration by introducing a new `ClientConfig` struct to replace the use of `RDKafkaClientConfig` directly. The changes improve code clarity, encapsulation, and configurability, particularly by adding support for a custom log level. The most important changes include replacing `RDKafkaClientConfig` with `ClientConfig` in multiple files, implementing the new `ClientConfig` struct, and updating the `KafkaReportBuilder` to use the new configuration. ### Refactoring Kafka Client Configuration: * **Introduction of `ClientConfig` struct**: - Added a new `ClientConfig` struct in `src/reporter/kafka.rs`, encapsulating Kafka configuration parameters and log levels. It includes methods for setting parameters, setting log levels, and converting to `RDKafkaClientConfig`. [[1]](diffhunk://#diff-1821ca44408ec1f5c71006cbc28527e0c3d45e319ff811f40ec7c3ab9de97755R54-R136) [[2]](diffhunk://#diff-1821ca44408ec1f5c71006cbc28527e0c3d45e319ff811f40ec7c3ab9de97755L74-R167) * **Replacement of `RDKafkaClientConfig` with `ClientConfig`**: - Updated references to `RDKafkaClientConfig` in `README.md` and `e2e/src/main.rs` to use the new `ClientConfig` struct. [[1]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L229-R236) [[2]](diffhunk://#diff-7971767c2f99a1ba6318ec299954e70b2f305f3d0b9763c51a49f100eb150041L38-R38) [[3]](diffhunk://#diff-7971767c2f99a1ba6318ec299954e70b2f305f3d0b9763c51a49f100eb150041L255-R255) ### Updates to `KafkaReportBuilder`: * **Refactored `KafkaReportBuilder` to use `ClientConfig`**: - Modified the `KafkaReportBuilder` struct and its methods to accept and work with `ClientConfig` instead of `RDKafkaClientConfig`. This includes changes to the `new`, `new_with_pc`, and `build` methods. [[1]](diffhunk://#diff-1821ca44408ec1f5c71006cbc28527e0c3d45e319ff811f40ec7c3ab9de97755L74-R167) [[2]](diffhunk://#diff-1821ca44408ec1f5c71006cbc28527e0c3d45e319ff811f40ec7c3ab9de97755L90-R176) [[3]](diffhunk://#diff-1821ca44408ec1f5c71006cbc28527e0c3d45e319ff811f40ec7c3ab9de97755L121-R207) These changes enhance the maintainability and flexibility of the Kafka client configuration by abstracting the configuration details into a dedicated struct. -- 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. To unsubscribe, e-mail: notifications-unsubscr...@skywalking.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org