docs: clarify kafka-only sink semantics
This commit is contained in:
@@ -12,9 +12,9 @@ public class KafkaSinkProperties {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Kafka Sink 总开关。默认 {@code true}。
|
* Kafka Sink 总开关。默认 {@code true}。
|
||||||
* 设为 {@code false} 时 {@link KafkaSinkAutoConfiguration} 完全不装配任何 Bean(Kafka Producer、
|
* 设为 {@code false} 时 {@link KafkaSinkAutoConfiguration} 不装配 Kafka Producer、
|
||||||
* EnvelopeMapper、TopicRouter、KafkaEventSink 都不会创建),ingest-core 的 DisruptorEventBus
|
* EnvelopeMapper、TopicRouter、KafkaEventSink 等生产端组件。生产接入应用保持默认开启,
|
||||||
* 仍然正常运行但没有外部 sink(事件落地到 sink-archive 或 Noop 吞掉)。
|
* 只有专门的查询/测试运行时才应关闭 Kafka sink。
|
||||||
*/
|
*/
|
||||||
private boolean enabled = true;
|
private boolean enabled = true;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package com.lingniu.ingest.sink.kafka;
|
|||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
@@ -23,4 +25,15 @@ class KafkaSinkPropertiesTest {
|
|||||||
assertThat(Arrays.stream(KafkaSinkProperties.class.getMethods()).map(method -> method.getName()))
|
assertThat(Arrays.stream(KafkaSinkProperties.class.getMethods()).map(method -> method.getName()))
|
||||||
.doesNotContain("getType", "setType");
|
.doesNotContain("getType", "setType");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void sourceCommentsDoNotDescribeKafkaDisabledAsNoopEventDropping() throws Exception {
|
||||||
|
String source = Files.readString(Path.of(
|
||||||
|
"src/main/java/com/lingniu/ingest/sink/kafka/KafkaSinkProperties.java"));
|
||||||
|
|
||||||
|
assertThat(source)
|
||||||
|
.doesNotContain("Noop")
|
||||||
|
.doesNotContain("吞掉")
|
||||||
|
.doesNotContain("外部 sink");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user