Package zipkin2.collector.kafka
Class KafkaCollector.Builder
- java.lang.Object
-
- zipkin2.collector.CollectorComponent.Builder
-
- zipkin2.collector.kafka.KafkaCollector.Builder
-
- Enclosing class:
- KafkaCollector
public static final class KafkaCollector.Builder extends CollectorComponent.Builder
Configuration including defaults needed to consume spans from a Kafka topic.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KafkaCollector.Builder
bootstrapServers(java.lang.String bootstrapServers)
The bootstrapServers connect string, ex.KafkaCollector
build()
KafkaCollector.Builder
groupId(java.lang.String groupId)
The consumer group this process is consuming on behalf of.KafkaCollector.Builder
metrics(CollectorMetrics metrics)
KafkaCollector.Builder
overrides(java.util.Map<java.lang.String,?> overrides)
By default, a consumer will be built from properties derived from builder defaults, as well as "auto.offset.reset" -> "earliest".KafkaCollector.Builder
sampler(CollectorSampler sampler)
KafkaCollector.Builder
storage(StorageComponent storage)
KafkaCollector.Builder
streams(int streams)
Count of threads consuming the topic.KafkaCollector.Builder
topic(java.lang.String topic)
Topic zipkin spans will be consumed from.
-
-
-
Method Detail
-
storage
public KafkaCollector.Builder storage(StorageComponent storage)
- Specified by:
storage
in classCollectorComponent.Builder
-
sampler
public KafkaCollector.Builder sampler(CollectorSampler sampler)
- Specified by:
sampler
in classCollectorComponent.Builder
-
metrics
public KafkaCollector.Builder metrics(CollectorMetrics metrics)
- Specified by:
metrics
in classCollectorComponent.Builder
-
topic
public KafkaCollector.Builder topic(java.lang.String topic)
Topic zipkin spans will be consumed from. Defaults to "zipkin". Multiple topics may be specified if comma delimited.
-
bootstrapServers
public KafkaCollector.Builder bootstrapServers(java.lang.String bootstrapServers)
The bootstrapServers connect string, ex. 127.0.0.1:9092. No default.
-
groupId
public KafkaCollector.Builder groupId(java.lang.String groupId)
The consumer group this process is consuming on behalf of. Defaults to "zipkin"
-
streams
public KafkaCollector.Builder streams(int streams)
Count of threads consuming the topic. Defaults to 1
-
overrides
public final KafkaCollector.Builder overrides(java.util.Map<java.lang.String,?> overrides)
By default, a consumer will be built from properties derived from builder defaults, as well as "auto.offset.reset" -> "earliest". Any properties set here will override the consumer config.For example: Only consume spans since you connected by setting the below.
Map<String, String> overrides = new LinkedHashMap<>(); overrides.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest"); builder.overrides(overrides);
- See Also:
ConsumerConfig
-
build
public KafkaCollector build()
- Specified by:
build
in classCollectorComponent.Builder
-
-