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



##########
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/jvm/JVMServiceSenderImpl.java
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.agent.core.jvm;
+
+import io.grpc.Channel;
+import java.util.LinkedList;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+import org.apache.skywalking.apm.agent.core.boot.DefaultImplementor;
+import org.apache.skywalking.apm.agent.core.boot.ServiceManager;
+import org.apache.skywalking.apm.agent.core.commands.CommandService;
+import org.apache.skywalking.apm.agent.core.conf.Config;
+import org.apache.skywalking.apm.agent.core.logging.api.ILog;
+import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
+import org.apache.skywalking.apm.agent.core.remote.GRPCChannelListener;
+import org.apache.skywalking.apm.agent.core.remote.GRPCChannelManager;
+import org.apache.skywalking.apm.agent.core.remote.GRPCChannelStatus;
+import org.apache.skywalking.apm.network.common.v3.Commands;
+import org.apache.skywalking.apm.network.language.agent.v3.JVMMetric;
+import org.apache.skywalking.apm.network.language.agent.v3.JVMMetricCollection;
+import 
org.apache.skywalking.apm.network.language.agent.v3.JVMMetricReportServiceGrpc;
+
+import static 
org.apache.skywalking.apm.agent.core.conf.Config.Collector.GRPC_UPSTREAM_TIMEOUT;
+
+@DefaultImplementor
+public class JVMServiceSenderImpl implements JVMServiceSender, 
GRPCChannelListener {

Review comment:
       I think this should be `JVMServiceGrpcSender`

##########
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java
##########
@@ -140,6 +140,25 @@
          * Get profile task list interval
          */
         public static int GET_PROFILE_TASK_INTERVAL = 20;
+
+        public static class Kafka {
+
+            public static String BOOTSTRAP_SERVERS;
+
+            public static int BATCH_SIZE = 1000;
+
+            public static String ACKS = "1";
+
+            public static String TOPIC_METRICS = "skywalking-metrics";
+
+            public static String TOPIC_PROFILING = "skywalking-profiling";
+
+            public static String TOPIC_SEGMENT = "skywalking-segment";
+
+            public static String TOPIC_MANAGEMENT = "skywalking-management";

Review comment:
       How are these topic(s) created?

##########
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/jvm/JVMServiceSender.java
##########
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.agent.core.jvm;
+
+import org.apache.skywalking.apm.agent.core.boot.BootService;
+import org.apache.skywalking.apm.network.language.agent.v3.JVMMetric;
+
+public interface JVMServiceSender extends BootService, Runnable {

Review comment:
       Comments are required.

##########
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/TracingContext.java
##########
@@ -116,7 +116,7 @@
     /**
      * Initialize all fields with default value.
      */
-    TracingContext(String firstOPName) {
+    public TracingContext(String firstOPName) {

Review comment:
       Why change this? Who will create new Tracing Context?

##########
File path: 
oap-server/server-receiver-plugin/skywalking-mq-receiver-plugins/kafka-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/kafka/provider/dispatcher/JVMSourceDispatcher.java
##########
@@ -0,0 +1,179 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.receiver.kafka.provider.dispatcher;
+
+import java.util.List;
+import org.apache.skywalking.apm.network.common.v3.CPU;
+import org.apache.skywalking.apm.network.language.agent.v3.GC;
+import org.apache.skywalking.apm.network.language.agent.v3.JVMMetric;
+import org.apache.skywalking.apm.network.language.agent.v3.Memory;
+import org.apache.skywalking.apm.network.language.agent.v3.MemoryPool;
+import org.apache.skywalking.oap.server.core.CoreModule;
+import org.apache.skywalking.oap.server.core.analysis.IDManager;
+import org.apache.skywalking.oap.server.core.analysis.NodeType;
+import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
+import org.apache.skywalking.oap.server.core.source.GCPhrase;
+import org.apache.skywalking.oap.server.core.source.MemoryPoolType;
+import org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMCPU;
+import org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMGC;
+import org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMMemory;
+import 
org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMMemoryPool;
+import org.apache.skywalking.oap.server.core.source.SourceReceiver;
+import org.apache.skywalking.oap.server.library.module.ModuleManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Copy from other receiver

Review comment:
       This comment doesn't make sense. If you want to say copy, that is mostly 
from another project, not ourselves. 

##########
File path: 
oap-server/server-receiver-plugin/skywalking-mq-receiver-plugins/kafka-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/kafka/provider/handler/JVMMetricsReceiveHandler.java
##########
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.receiver.kafka.provider.handler;
+
+import com.google.protobuf.InvalidProtocolBufferException;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.kafka.clients.consumer.ConsumerRecord;
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.common.utils.Bytes;
+import org.apache.skywalking.apm.network.language.agent.v3.JVMMetricCollection;
+import org.apache.skywalking.oap.server.core.CoreModule;
+import org.apache.skywalking.oap.server.core.config.NamingLengthControl;
+import org.apache.skywalking.oap.server.library.module.ModuleManager;
+import 
org.apache.skywalking.oap.server.receiver.kafka.module.KafkaReceiverConfig;
+import 
org.apache.skywalking.oap.server.receiver.kafka.provider.dispatcher.JVMSourceDispatcher;
+
+@Slf4j
+public class JVMMetricsReceiveHandler implements KafkaReceiveHandler {

Review comment:
       All handler names should be renamed to `KafkaConsumer`, as this is what 
you are doing.

##########
File path: 
oap-server/server-receiver-plugin/skywalking-mq-receiver-plugins/mq-receiver-common/pom.xml
##########
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <parent>
+        <artifactId>skywalking-mq-receiver-plugins</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>8.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>mq-receiver-common</artifactId>

Review comment:
       What is this for? Are all MQs same? I have doubts about this. What could 
be reused across these? 
   From my understanding, the MQ consumers at the OAP side are about to use MQ 
native client API and transport them into the source, that is alll.

##########
File path: apm-sniffer/optional-producer-plugins/kafka-producer-plugin/pom.xml
##########
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <parent>
+        <artifactId>optional-producer-plugins</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>8.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>kafka-producer-plugin</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>apm-agent-core</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>apm-util</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>apm-test-tools</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.kafka</groupId>
+            <artifactId>kafka-clients</artifactId>
+            <version>${kafk-clients.version}</version>

Review comment:
       Where do we shade this dependency? And dist LICENSE/NOTICE/dep license 
files has to update, due to you include more things.

##########
File path: 
apm-sniffer/optional-producer-plugins/kafka-producer-plugin/src/main/java/org/apache/skywalking/apm/agent/core/kafka/KafkaProfileTaskService.java
##########
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.agent.core.kafka;
+
+import java.util.ArrayList;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.ProducerRecord;
+import org.apache.kafka.common.utils.Bytes;
+import org.apache.skywalking.apm.agent.core.boot.DefaultNamedThreadFactory;
+import org.apache.skywalking.apm.agent.core.boot.OverrideImplementor;
+import org.apache.skywalking.apm.agent.core.boot.ServiceManager;
+import org.apache.skywalking.apm.agent.core.conf.Config;
+import org.apache.skywalking.apm.agent.core.logging.api.ILog;
+import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
+import org.apache.skywalking.apm.agent.core.profile.ProfileTaskChannelService;
+import org.apache.skywalking.apm.agent.core.profile.TracingThreadSnapshot;
+import org.apache.skywalking.apm.agent.core.remote.GRPCChannelManager;
+import org.apache.skywalking.apm.network.language.profile.v3.ThreadSnapshot;
+import org.apache.skywalking.apm.util.RunnableWithExceptionProtection;
+
+/**
+ * Considering that MessageQueue belongs to a decoupled architecture, 
therefore we do not support this. The MQ is not
+ * good for real-time interactive. It will be implemented through Rest API.

Review comment:
       What does this comment mean? What Rest API? All codes below are using 
Kafka related tech stack. Confusing.

##########
File path: 
oap-server/server-receiver-plugin/skywalking-mq-receiver-plugins/kafka-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/kafka/provider/dispatcher/JVMSourceDispatcher.java
##########
@@ -0,0 +1,179 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.receiver.kafka.provider.dispatcher;
+
+import java.util.List;
+import org.apache.skywalking.apm.network.common.v3.CPU;
+import org.apache.skywalking.apm.network.language.agent.v3.GC;
+import org.apache.skywalking.apm.network.language.agent.v3.JVMMetric;
+import org.apache.skywalking.apm.network.language.agent.v3.Memory;
+import org.apache.skywalking.apm.network.language.agent.v3.MemoryPool;
+import org.apache.skywalking.oap.server.core.CoreModule;
+import org.apache.skywalking.oap.server.core.analysis.IDManager;
+import org.apache.skywalking.oap.server.core.analysis.NodeType;
+import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
+import org.apache.skywalking.oap.server.core.source.GCPhrase;
+import org.apache.skywalking.oap.server.core.source.MemoryPoolType;
+import org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMCPU;
+import org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMGC;
+import org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMMemory;
+import 
org.apache.skywalking.oap.server.core.source.ServiceInstanceJVMMemoryPool;
+import org.apache.skywalking.oap.server.core.source.SourceReceiver;
+import org.apache.skywalking.oap.server.library.module.ModuleManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Copy from other receiver
+ */
+public class JVMSourceDispatcher {
+    private static final Logger logger = 
LoggerFactory.getLogger(JVMSourceDispatcher.class);

Review comment:
       Unexpected logger,

##########
File path: 
apm-sniffer/optional-producer-plugins/kafka-producer-plugin/src/main/java/org/apache/skywalking/apm/agent/core/kafka/MessageQueueServiceManagement.java
##########
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.agent.core.kafka;
+
+import java.util.Properties;
+import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.ProducerConfig;
+import org.apache.kafka.common.serialization.BytesSerializer;
+import org.apache.kafka.common.serialization.StringSerializer;
+import org.apache.kafka.common.utils.Bytes;
+import org.apache.skywalking.apm.agent.core.boot.BootService;
+import org.apache.skywalking.apm.agent.core.boot.DefaultImplementor;
+import org.apache.skywalking.apm.agent.core.conf.Config;
+import org.apache.skywalking.apm.agent.core.logging.api.ILog;
+import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
+
+@DefaultImplementor
+public class MessageQueueServiceManagement implements BootService, Runnable {
+    private static final ILog logger = 
LogManager.getLogger(MessageQueueServiceManagement.class);
+    private KafkaProducer<String, Bytes> producer;
+
+    @Override
+    public void prepare() {
+        Properties properties = new Properties();
+        properties.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, 
Config.Collector.Kafka.BOOTSTRAP_SERVERS);
+        properties.setProperty(ProducerConfig.BATCH_SIZE_CONFIG, 
String.valueOf(Config.Collector.Kafka.BATCH_SIZE));
+        properties.setProperty(ProducerConfig.ACKS_CONFIG, 
Config.Collector.Kafka.ACKS);
+
+        Config.Collector.Kafka.CONSUMER_CONFIG.forEach((k, v) -> 
properties.setProperty(k, v));
+
+        if (!properties.contains("max.block.ms")) {

Review comment:
       What is this? Why is there a config not from the official way?

##########
File path: 
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java
##########
@@ -140,6 +140,25 @@
          * Get profile task list interval
          */
         public static int GET_PROFILE_TASK_INTERVAL = 20;
+
+        public static class Kafka {

Review comment:
       Comments

##########
File path: 
oap-server/server-receiver-plugin/skywalking-mq-receiver-plugins/kafka-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/kafka/provider/KafkaReceiverProvider.java
##########
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.receiver.kafka.provider;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.oap.server.configuration.api.ConfigurationModule;
+import org.apache.skywalking.oap.server.core.CoreModule;
+import org.apache.skywalking.oap.server.core.cluster.ClusterModule;
+import org.apache.skywalking.oap.server.library.module.ModuleConfig;
+import org.apache.skywalking.oap.server.library.module.ModuleDefine;
+import org.apache.skywalking.oap.server.library.module.ModuleProvider;
+import org.apache.skywalking.oap.server.library.module.ModuleStartException;
+import 
org.apache.skywalking.oap.server.library.module.ServiceNotProvidedException;
+import 
org.apache.skywalking.oap.server.receiver.kafka.KafkaReceiveHandlerRegister;
+import 
org.apache.skywalking.oap.server.receiver.kafka.module.KafkaReceiverConfig;
+import 
org.apache.skywalking.oap.server.receiver.kafka.provider.handler.JVMMetricsReceiveHandler;
+import 
org.apache.skywalking.oap.server.receiver.kafka.provider.handler.KafkaManagementReceiveHandler;
+import 
org.apache.skywalking.oap.server.receiver.kafka.provider.handler.TraceSegmentReceiveHandler;
+import org.apache.skywalking.oap.server.receiver.mq.ReceiveHandlerRegister;
+import 
org.apache.skywalking.oap.server.receiver.mq.module.MessageQueueReceiverModule;
+import 
org.apache.skywalking.oap.server.receiver.sharing.server.SharingServerModule;
+import 
org.apache.skywalking.oap.server.receiver.trace.provider.TraceServiceModuleConfig;
+import 
org.apache.skywalking.oap.server.receiver.trace.provider.parser.SegmentParserListenerManager;
+import 
org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener.MultiScopesAnalysisListener;
+import 
org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener.NetworkAddressAliasMappingListener;
+import 
org.apache.skywalking.oap.server.receiver.trace.provider.parser.listener.SegmentAnalysisListener;
+import org.apache.skywalking.oap.server.telemetry.TelemetryModule;
+
+@Slf4j
+public class KafkaReceiverProvider extends ModuleProvider {
+    private KafkaReceiverConfig config;
+    private KafkaReceiveHandlerRegister handlerRegister;
+    private TraceServiceModuleConfig traceServiceModuleConfig;
+
+    public KafkaReceiverProvider() {
+        config = new KafkaReceiverConfig();
+    }
+
+    @Override
+    public String name() {
+        return "kafka";
+    }
+
+    @Override
+    public Class<? extends ModuleDefine> module() {
+        return MessageQueueReceiverModule.class;
+    }
+
+    @Override
+    public ModuleConfig createConfigBeanIfAbsent() {
+        return config;
+    }
+
+    @Override
+    public void prepare() throws ServiceNotProvidedException, 
ModuleStartException {
+        handlerRegister = new KafkaReceiveHandlerRegister(config);
+        this.registerServiceImplementation(ReceiveHandlerRegister.class, 
handlerRegister);
+    }
+
+    @Override
+    public void start() throws ServiceNotProvidedException, 
ModuleStartException {

Review comment:
       I think once you are opening receiver, this should take the 
responsibility of creating topic(s), right?




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


Reply via email to