Class PushPulsarSource<T>

java.lang.Object
org.apache.pulsar.functions.source.PulsarSource<T>
org.apache.pulsar.functions.source.PushPulsarSource<T>
All Implemented Interfaces:
AutoCloseable, Source<T>
Direct Known Subclasses:
MultiConsumerPulsarSource

public abstract class PushPulsarSource<T> extends PulsarSource<T>
  • Constructor Details

  • Method Details

    • read

      public Record<T> read() throws Exception
      Throws:
      Exception
    • open

      public abstract void open(Map<String,Object> config, SourceContext sourceContext) throws Exception
      Open connector with configuration.
      Parameters:
      config - initialization config
      sourceContext - environment where the source connector is running
      Throws:
      Exception - IO type exceptions when opening a connector
    • consume

      public void consume(Record<T> record)
      Attach a consumer function to this Source. This is invoked by the implementation to pass messages whenever there is data to be pushed to Pulsar.
      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