Class PulsarConsumerBuilder<M,T>

java.lang.Object
com.hazelcast.jet.pulsar.PulsarConsumerBuilder<M,T>
Type Parameters:
M - the type of the value of message read by PulsarConsumer
T - the type of the emitted item after projection.
All Implemented Interfaces:
Serializable

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

    • PulsarConsumerBuilder

      public PulsarConsumerBuilder(@Nonnull List<String> topics, @Nonnull SupplierEx<org.apache.pulsar.client.api.PulsarClient> connectionSupplier, @Nonnull SupplierEx<org.apache.pulsar.client.api.Schema<M>> schemaSupplier, @Nonnull FunctionEx<org.apache.pulsar.client.api.Message<M>,T> projectionFn)
      Required fields of Pulsar consumer.
      Parameters:
      topics - the topics to consume, at least one is required
      connectionSupplier - Pulsar client supplier
      schemaSupplier - supplies the schema for consuming messages
      projectionFn - converts a Pulsar message to an emitted item.
  • Method Details

    • consumerConfig

      @Nonnull public PulsarConsumerBuilder<M,T> consumerConfig(@Nonnull Map<String,Object> consumerConfig)
      Parameters:
      consumerConfig - Pulsar consumer configurations that must contain consumer name, and subscription name.
    • batchReceivePolicySupplier

      @Nonnull public PulsarConsumerBuilder<M,T> batchReceivePolicySupplier(@Nonnull SupplierEx<org.apache.pulsar.client.api.BatchReceivePolicy> batchReceivePolicySupplier)
      Parameters:
      batchReceivePolicySupplier - supplies the batch receive policy for the consumer
    • build

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