Package com.hazelcast.jet.pulsar
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 byPulsarConsumerT- the type of the emitted item after projection.
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPulsarConsumerBuilder(List<String> topics, SupplierEx<org.apache.pulsar.client.api.PulsarClient> connectionSupplier, SupplierEx<org.apache.pulsar.client.api.Schema<M>> schemaSupplier, FunctionEx<org.apache.pulsar.client.api.Message<M>, T> projectionFn) Required fields of Pulsar consumer. -
Method Summary
Modifier and TypeMethodDescriptionbatchReceivePolicySupplier(SupplierEx<org.apache.pulsar.client.api.BatchReceivePolicy> batchReceivePolicySupplier) build()Creates and returns the Pulsar ConsumerStreamSourcewith using builder configurations set before.consumerConfig(Map<String, Object> consumerConfig)
-
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 requiredconnectionSupplier- Pulsar client supplierschemaSupplier- supplies the schema for consuming messagesprojectionFn- 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
Creates and returns the Pulsar ConsumerStreamSourcewith using builder configurations set before.
-