This is an automated email from the ASF dual-hosted git repository.

likeguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new 6ed35b279 Get topic from config in KafkaLogCollectClient (#4756)
6ed35b279 is described below

commit 6ed35b2797c3e1e7955bc802ca969a8051511c1f
Author: Will.Feng <[email protected]>
AuthorDate: Sat Jun 24 22:10:18 2023 +0800

    Get topic from config in KafkaLogCollectClient (#4756)
---
 .../shenyu/plugin/logging/kafka/client/KafkaLogCollectClient.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-kafka/src/main/java/org/apache/shenyu/plugin/logging/kafka/client/KafkaLogCollectClient.java
 
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-kafka/src/main/java/org/apache/shenyu/plugin/logging/kafka/client/KafkaLogCollectClient.java
index 96dcce14f..e18f2fea6 100644
--- 
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-kafka/src/main/java/org/apache/shenyu/plugin/logging/kafka/client/KafkaLogCollectClient.java
+++ 
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-kafka/src/main/java/org/apache/shenyu/plugin/logging/kafka/client/KafkaLogCollectClient.java
@@ -70,7 +70,7 @@ public class KafkaLogCollectClient extends 
AbstractLogConsumeClient<KafkaLogColl
             LOG.error("kafka props is empty. failed init kafka producer");
             return;
         }
-        String topic = "shenyu-access-logging";
+        String topic = config.getTopic();
         String nameserverAddress = config.getNamesrvAddr();
 
         if (StringUtils.isBlank(topic) || 
StringUtils.isBlank(nameserverAddress)) {
@@ -93,7 +93,7 @@ public class KafkaLogCollectClient extends 
AbstractLogConsumeClient<KafkaLogColl
                                     config.getUserName(), 
config.getPassWord()));
         }
         producer = new KafkaProducer<>(props);
-        ProducerRecord<String, String> record = new 
ProducerRecord<>("shenyu-access-logging", StringSerializer.class.getName(), 
StringSerializer.class.getName());
+        ProducerRecord<String, String> record = new 
ProducerRecord<>(this.topic, StringSerializer.class.getName(), 
StringSerializer.class.getName());
         try {
             producer.send(record);
             LOG.info("init kafkaLogCollectClient success");

Reply via email to