Package com.hazelcast.jet.pulsar
Class PulsarSinkBuilder<E,M>
java.lang.Object
com.hazelcast.jet.pulsar.PulsarSinkBuilder<E,M>
- Type Parameters:
E- the type of stream itemM- the type of the message published byPulsarProducer
- Since:
- 6.0
-
Constructor Summary
ConstructorsConstructorDescriptionPulsarSinkBuilder(SupplierEx<org.apache.pulsar.client.api.Schema<M>> schemaSupplier, FunctionEx<? super E, M> extractValueFn) PulsarSinkBuilder(String topic, SupplierEx<org.apache.pulsar.client.api.PulsarClient> connectionSupplier, SupplierEx<org.apache.pulsar.client.api.Schema<M>> schemaSupplier, FunctionEx<? super E, M> extractValueFn) Required fields of Pulsar sink -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates and returns the PulsarSinkwith using builder configurations set before.connectionSupplier(SupplierEx<org.apache.pulsar.client.api.PulsarClient> connectionSupplier) dataConnectionRef(DataConnectionRef dataConnectionRef) extractKeyFn(FunctionEx<? super E, String> extractKeyFn) extractPropertiesFn(FunctionEx<? super E, Map<String, String>> extractPropertiesFn) extractTimestampFn(FunctionEx<? super E, Long> extractTimestampFn) extractValueFn(FunctionEx<? super E, M> extractValueFn) httpServiceUrl(String httpServiceUrl) <NEW_E> PulsarSinkBuilder<NEW_E,M> Helper function to force type interference.preferredLocalParallelism(int preferredLocalParallelism) Preferred local parallelism for every processor created by this builder.producerConfig(Map<String, Object> producerConfig) producerCustomizer(ConsumerEx<@NonNull org.apache.pulsar.client.api.ProducerBuilder<M>> producerCustomizer) Customizer of theProducerBuildercreated by this sink.transactionTimeout(Duration transactionTimeout) useTransactions(boolean enable) Enables or disables the exactly-once behavior of the sink using two-phase commit of state snapshots.
-
Constructor Details
-
PulsarSinkBuilder
public PulsarSinkBuilder(@Nonnull SupplierEx<org.apache.pulsar.client.api.Schema<M>> schemaSupplier, @Nonnull FunctionEx<? super E, M> extractValueFn) -
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 toconnectionSupplier- Pulsar client supplierextractValueFn- extracts the message value from the emitted items.schemaSupplier- Pulsar messaging schema supplier.
-
-
Method Details
-
inputType
Helper function to force type interference.PulsarSinkBuildershould be equal toPulsarSinkBuilder. -
topic
-
connectionSupplier
@Nonnull public PulsarSinkBuilder<E,M> connectionSupplier(@Nonnull SupplierEx<org.apache.pulsar.client.api.PulsarClient> connectionSupplier) -
httpServiceUrl
-
dataConnectionRef
@Nonnull public PulsarSinkBuilder<E,M> dataConnectionRef(@Nonnull DataConnectionRef dataConnectionRef) -
producerConfig
- Parameters:
producerConfig- The configurations forPulsarProducer
-
extractKeyFn
- Parameters:
extractKeyFn- extracts the message key from the emitted items.
-
extractValueFn
- Parameters:
extractValueFn- extracts the message value 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.
-
transactionTimeout
- Parameters:
transactionTimeout- timeout for transactions, that will be used if there is processing guarantee specified for the job
-
useTransactions
Enables or disables the exactly-once behavior of the sink using two-phase commit of state snapshots. If enabled, the processing guarantee of the job must be set to exactly-once, otherwise the sink guarantee will match that of the job. In other words, sink guarantee cannot be higher than job's, but can be lowered to avoid the additional overhead.The default value is true.
- Parameters:
enable- If true, sink guarantee will match the job guarantee. If false, sink guarantee will be at-least-once even if job's is exactly-once- Returns:
- this instance for fluent API
-
preferredLocalParallelism
Preferred local parallelism for every processor created by this builder. -
producerCustomizer
@Nonnull public PulsarSinkBuilder<E,M> producerCustomizer(@Nonnull ConsumerEx<@NonNull org.apache.pulsar.client.api.ProducerBuilder<M>> producerCustomizer) Customizer of theProducerBuildercreated by this sink. -
build
Creates and returns the PulsarSinkwith using builder configurations set before.
-