Package org.apache.pulsar.io.kafka
Class KafkaAbstractSource<V>
java.lang.Object
org.apache.pulsar.io.core.AbstractPushSource<T>
org.apache.pulsar.io.core.PushSource<V>
org.apache.pulsar.io.kafka.KafkaAbstractSource<V>
- All Implemented Interfaces:
AutoCloseable,Source<V>
- Direct Known Subclasses:
KafkaBytesSource,KafkaStringSource
Simple Kafka Source to transfer messages from a Kafka topic.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PropertiesbeforeCreateConsumer(Properties props) abstract KafkaAbstractSource.KafkaRecord<V>buildRecord(org.apache.kafka.clients.consumer.ConsumerRecord<Object, Object> consumerRecord) voidclose()copyKafkaHeaders(org.apache.kafka.clients.consumer.ConsumerRecord<Object, Object> consumerRecord) voidopen(Map<String, Object> config, SourceContext sourceContext) voidstart()Methods inherited from class org.apache.pulsar.io.core.PushSource
readMethods inherited from class org.apache.pulsar.io.core.AbstractPushSource
consume, getQueueLength, notifyError, readNext
-
Field Details
-
HEADER_KAFKA_TOPIC_KEY
- See Also:
-
HEADER_KAFKA_PTN_KEY
- See Also:
-
HEADER_KAFKA_OFFSET_KEY
- See Also:
-
-
Constructor Details
-
KafkaAbstractSource
public KafkaAbstractSource()
-
-
Method Details
-
open
- Throws:
Exception
-
beforeCreateConsumer
-
close
- Throws:
InterruptedException
-
start
public void start() -
buildRecord
public abstract KafkaAbstractSource.KafkaRecord<V> buildRecord(org.apache.kafka.clients.consumer.ConsumerRecord<Object, Object> consumerRecord) -
copyKafkaHeaders
-