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(SupplierEx<org.apache.pulsar.client.api.Schema<M>> schemaSupplier, FunctionEx<org.apache.pulsar.client.api.Message<M>, T> projectionFn) PulsarConsumerBuilder(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) All-required fields constructor of Pulsar consumer, kept for compatibility with older code from hazeclast-jet-contrib repository. -
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.connectionSupplier(SupplierEx<org.apache.pulsar.client.api.PulsarClient> connectionSupplier) consumerConfig(Map<String, Object> consumerConfig) dataConnectionRef(DataConnectionRef dataConnectionRef) <NEW_T> PulsarConsumerBuilder<M,NEW_T> projectionFn(FunctionEx<org.apache.pulsar.client.api.Message<M>, NEW_T> projectionFn)
-
Constructor Details
-
PulsarConsumerBuilder
public PulsarConsumerBuilder(@Nonnull SupplierEx<org.apache.pulsar.client.api.Schema<M>> schemaSupplier, @Nonnull FunctionEx<org.apache.pulsar.client.api.Message<M>, T> projectionFn) -
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) All-required fields constructor of Pulsar consumer, kept for compatibility with older code from hazeclast-jet-contrib repository.- 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
-
topic
-
connectionSupplier
@Nonnull public PulsarConsumerBuilder<M,T> connectionSupplier(SupplierEx<org.apache.pulsar.client.api.PulsarClient> connectionSupplier) -
dataConnectionRef
@Nonnull public PulsarConsumerBuilder<M,T> dataConnectionRef(@Nonnull DataConnectionRef dataConnectionRef) -
projectionFn
@Nonnull public <NEW_T> PulsarConsumerBuilder<M,NEW_T> projectionFn(FunctionEx<org.apache.pulsar.client.api.Message<M>, NEW_T> projectionFn) -
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.
-