Package zipkin2.reporter.kafka11
Class KafkaSender
- java.lang.Object
-
- zipkin2.Component
-
- zipkin2.reporter.Sender
-
- zipkin2.reporter.kafka11.KafkaSender
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public final class KafkaSender extends zipkin2.reporter.SenderThis sends (usually json v2) encoded spans to a Kafka topic.This sender is thread-safe.
This sender is linked against Kafka 0.10.2+, which allows it to work with Kafka 0.10+ brokers
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKafkaSender.BuilderConfiguration including defaults needed to send spans to a Kafka topic.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description zipkin2.CheckResultcheck()Ensures there are no problems reading metadata about the topic.voidclose()static KafkaSendercreate(java.lang.String bootstrapServers)Creates a sender that sendsEncoding.JSONmessages.zipkin2.codec.Encodingencoding()intmessageMaxBytes()intmessageSizeInBytes(int encodedSizeInBytes)intmessageSizeInBytes(java.util.List<byte[]> encodedSpans)static KafkaSender.BuildernewBuilder()zipkin2.Call<java.lang.Void>sendSpans(java.util.List<byte[]> encodedSpans)This sends all of the spans as a single message.KafkaSender.BuildertoBuilder()java.lang.StringtoString()
-
-
-
Method Detail
-
create
public static KafkaSender create(java.lang.String bootstrapServers)
Creates a sender that sendsEncoding.JSONmessages.
-
newBuilder
public static KafkaSender.Builder newBuilder()
-
toBuilder
public KafkaSender.Builder toBuilder()
-
messageSizeInBytes
public int messageSizeInBytes(java.util.List<byte[]> encodedSpans)
- Specified by:
messageSizeInBytesin classzipkin2.reporter.Sender
-
messageSizeInBytes
public int messageSizeInBytes(int encodedSizeInBytes)
- Overrides:
messageSizeInBytesin classzipkin2.reporter.Sender
-
encoding
public zipkin2.codec.Encoding encoding()
- Specified by:
encodingin classzipkin2.reporter.Sender
-
messageMaxBytes
public int messageMaxBytes()
- Specified by:
messageMaxBytesin classzipkin2.reporter.Sender
-
sendSpans
public zipkin2.Call<java.lang.Void> sendSpans(java.util.List<byte[]> encodedSpans)
This sends all of the spans as a single message.NOTE: this blocks until the metadata server is available.
- Specified by:
sendSpansin classzipkin2.reporter.Sender
-
check
public zipkin2.CheckResult check()
Ensures there are no problems reading metadata about the topic.- Overrides:
checkin classzipkin2.Component
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classzipkin2.Component
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-