Package kieker.monitoring.writer.kafka
Class KafkaWriter
java.lang.Object
kieker.monitoring.writer.kafka.KafkaWriter
- All Implemented Interfaces:
IRawDataWriter
public class KafkaWriter extends java.lang.Object implements IRawDataWriter
Raw data writer which sends monitoring records to a Kafka topic.
- Since:
- 1.13
- Author:
- Holger Knoche
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONFIG_PROPERTY_ACKS
The name of the configuration property for the acks parameter.static java.lang.String
CONFIG_PROPERTY_BATCH_SIZE
The name of the configuration property for the batch size.static java.lang.String
CONFIG_PROPERTY_BOOTSTRAP_SERVERS
The name of the configuration property for the bootstrap servers.static java.lang.String
CONFIG_PROPERTY_BUFFER_MEMORY
The name of the configuration property for the buffer memory size.static java.lang.String
CONFIG_PROPERTY_LINGER_MS
The name of the configuration property for the linger interval.static java.lang.String
CONFIG_PROPERTY_TOPIC_NAME
The name of the configuration property for the topic name. -
Constructor Summary
Constructors Constructor Description KafkaWriter(Configuration configuration)
Creates a new Kafka writer using the given configuration. -
Method Summary
Modifier and Type Method Description void
onInitialization()
Called by the collector during initialization (before any records are written).void
onTermination()
Called by the collector upon termination (after remaining records have been flushed).void
writeData(java.nio.ByteBuffer buffer, int offset, int length)
Writes raw data contained in the given byte buffer.
-
Field Details
-
CONFIG_PROPERTY_ACKS
public static final java.lang.String CONFIG_PROPERTY_ACKSThe name of the configuration property for the acks parameter. -
CONFIG_PROPERTY_BATCH_SIZE
public static final java.lang.String CONFIG_PROPERTY_BATCH_SIZEThe name of the configuration property for the batch size. -
CONFIG_PROPERTY_BOOTSTRAP_SERVERS
public static final java.lang.String CONFIG_PROPERTY_BOOTSTRAP_SERVERSThe name of the configuration property for the bootstrap servers. -
CONFIG_PROPERTY_BUFFER_MEMORY
public static final java.lang.String CONFIG_PROPERTY_BUFFER_MEMORYThe name of the configuration property for the buffer memory size. -
CONFIG_PROPERTY_LINGER_MS
public static final java.lang.String CONFIG_PROPERTY_LINGER_MSThe name of the configuration property for the linger interval. -
CONFIG_PROPERTY_TOPIC_NAME
public static final java.lang.String CONFIG_PROPERTY_TOPIC_NAMEThe name of the configuration property for the topic name.
-
-
Constructor Details
-
KafkaWriter
Creates a new Kafka writer using the given configuration.- Parameters:
configuration
- The configuration to use
-
-
Method Details
-
onInitialization
public void onInitialization()Description copied from interface:IRawDataWriter
Called by the collector during initialization (before any records are written).- Specified by:
onInitialization
in interfaceIRawDataWriter
-
onTermination
public void onTermination()Description copied from interface:IRawDataWriter
Called by the collector upon termination (after remaining records have been flushed).- Specified by:
onTermination
in interfaceIRawDataWriter
-
writeData
public void writeData(java.nio.ByteBuffer buffer, int offset, int length)Description copied from interface:IRawDataWriter
Writes raw data contained in the given byte buffer.- Specified by:
writeData
in interfaceIRawDataWriter
- Parameters:
buffer
- The buffer containing the dataoffset
- The offset in the buffer where the data startslength
- The length of the data to write
-