diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/listener/DebugListener.java b/backend/services/api-test/src/main/java/io/metersphere/api/listener/DebugListener.java index 5d0ad474b5..bb54fdfaac 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/listener/DebugListener.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/listener/DebugListener.java @@ -7,13 +7,13 @@ import io.metersphere.sdk.util.LogUtils; import io.metersphere.sdk.util.WebSocketUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.kafka.clients.consumer.ConsumerRecord; -import org.springframework.context.annotation.Configuration; import org.springframework.kafka.annotation.KafkaListener; +import org.springframework.stereotype.Component; /** * 后端调试消息监听器 */ -@Configuration +@Component public class DebugListener { public static final String DEBUG_CONSUME_ID = "MS-API-DEBUG-CONSUME"; diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/listener/MessageListener.java b/backend/services/api-test/src/main/java/io/metersphere/api/listener/MessageListener.java index 04790c3480..e2b6981f6b 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/listener/MessageListener.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/listener/MessageListener.java @@ -14,10 +14,10 @@ import jakarta.annotation.Resource; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.kafka.clients.consumer.ConsumerRecord; -import org.springframework.context.annotation.Configuration; import org.springframework.kafka.annotation.KafkaListener; +import org.springframework.stereotype.Component; -@Configuration +@Component public class MessageListener { public static final String MESSAGE_CONSUME_ID = "MS-API-MESSAGE-CONSUME"; @Resource