Class PulsarSinkBuilder<E,M>

java.lang.Object
com.hazelcast.jet.pulsar.PulsarSinkBuilder<E,M>
Type Parameters:
E - the type of stream item
M - the type of the message published by PulsarProducer
All Implemented Interfaces:
Serializable

public final class PulsarSinkBuilder<E,M> extends Object implements Serializable
See Also:
  • Constructor Details

    • PulsarSinkBuilder

      public PulsarSinkBuilder(@Nonnull String topic, @Nonnull SupplierEx<org.apache.pulsar.client.api.PulsarClient> connectionSupplier, @Nonnull SupplierEx<org.apache.pulsar.client.api.Schema<M>> schemaSupplier, @Nonnull FunctionEx<? super E,M> extractValueFn)
      Required fields of Pulsar sink
      Parameters:
      topic - Pulsar topic name to publish to
      connectionSupplier - Pulsar client supplier
      extractValueFn - extracts the message value from the emitted items.
      schemaSupplier - Pulsar messaging schema supplier.
  • Method Details

    • producerConfig

      @Nonnull public PulsarSinkBuilder<E,M> producerConfig(Map<String,Object> producerConfig)
      Parameters:
      producerConfig - The configurations for PulsarProducer
    • extractKeyFn

      @Nonnull public PulsarSinkBuilder<E,M> extractKeyFn(FunctionEx<? super E,String> extractKeyFn)
      Parameters:
      extractKeyFn - extracts the message key from the emitted items.
    • extractPropertiesFn

      @Nonnull public PulsarSinkBuilder<E,M> extractPropertiesFn(FunctionEx<? super E,Map<String,String>> extractPropertiesFn)
      Parameters:
      extractPropertiesFn - extracts the message properties from the emitted items.
    • extractTimestampFn

      @Nonnull public PulsarSinkBuilder<E,M> extractTimestampFn(FunctionEx<? super E,Long> extractTimestampFn)
      Parameters:
      extractTimestampFn - the function that extracts the timestamp from the emitted item.
    • preferredLocalParallelism

      @Nonnull public PulsarSinkBuilder<E,M> preferredLocalParallelism(int preferredLocalParallelism)
    • build

      @Nonnull public Sink<E> build()
      Creates and returns the Pulsar Sink with using builder configurations set before.