Package org.apache.pulsar.io.kafka
Class KafkaPushSource<T>
java.lang.Object
org.apache.pulsar.io.kafka.KafkaPushSource<T>
- All Implemented Interfaces:
AutoCloseable,org.apache.pulsar.io.core.Source<T>
- Direct Known Subclasses:
KafkaAbstractSource
public abstract class KafkaPushSource<T>
extends Object
implements org.apache.pulsar.io.core.Source<T>
Kafka Push Source.
To maintain compatibility, we can't pick the PIP-281: https://github.com/apache/pulsar/pull/20807
cherry-pick to the historical version, so the class is implemented in the kafka connector.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSend this message to be written to Pulsar.intGet length of the queue that records are push onto.voidnotifyError(Exception ex) Allows the source to notify errors asynchronously.org.apache.pulsar.functions.api.Record<T>read()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.AutoCloseable
closeMethods inherited from interface org.apache.pulsar.io.core.Source
open
-
Constructor Details
-
KafkaPushSource
public KafkaPushSource()
-
-
Method Details
-
read
-
consume
Send this message to be written to Pulsar. Pass null if you you are done with this task- Parameters:
record- next message from source which should be sent to a Pulsar topic
-
getQueueLength
public int getQueueLength()Get length of the queue that records are push onto. Users can override this method to customize the queue length- Returns:
- queue length
-
notifyError
Allows the source to notify errors asynchronously.- Parameters:
ex-
-