| Package | Description |
|---|---|
| org.apache.pulsar.client.api |
Pulsar Client API.
|
| Modifier and Type | Method and Description |
|---|---|
ProducerBuilder<T> |
ProducerBuilder.accessMode(ProducerAccessMode accessMode)
Configure the type of access mode that the producer requires on the topic.
|
ProducerBuilder<T> |
ProducerBuilder.addEncryptionKey(String key)
Add public encryption key, used by producer to encrypt the data key.
|
ProducerBuilder<T> |
ProducerBuilder.autoUpdatePartitions(boolean autoUpdate)
If enabled, partitioned producer will automatically discover new partitions at runtime.
|
ProducerBuilder<T> |
ProducerBuilder.autoUpdatePartitionsInterval(int interval,
TimeUnit unit)
Set the interval of updating partitions (default: 1 minute).
|
ProducerBuilder<T> |
ProducerBuilder.batcherBuilder(BatcherBuilder batcherBuilder)
Set the batcher builder
BatcherBuilder of the producer. |
ProducerBuilder<T> |
ProducerBuilder.batchingMaxBytes(int batchingMaxBytes)
Set the maximum number of bytes permitted in a batch.
|
ProducerBuilder<T> |
ProducerBuilder.batchingMaxMessages(int batchMessagesMaxMessagesPerBatch)
Set the maximum number of messages permitted in a batch.
|
ProducerBuilder<T> |
ProducerBuilder.batchingMaxPublishDelay(long batchDelay,
TimeUnit timeUnit)
Set the time period within which the messages sent will be batched default: 1 ms if batch messages are
enabled.
|
ProducerBuilder<T> |
ProducerBuilder.blockIfQueueFull(boolean blockIfQueueFull)
Set whether the
Producer.send(T) and Producer.sendAsync(T) operations should block when the outgoing
message queue is full. |
ProducerBuilder<T> |
ProducerBuilder.clone()
Create a copy of the current
ProducerBuilder. |
ProducerBuilder<T> |
ProducerBuilder.compressionType(CompressionType compressionType)
Set the compression type for the producer.
|
ProducerBuilder<T> |
ProducerBuilder.cryptoFailureAction(ProducerCryptoFailureAction action)
Sets the ProducerCryptoFailureAction to the value specified.
|
ProducerBuilder<T> |
ProducerBuilder.cryptoKeyReader(CryptoKeyReader cryptoKeyReader)
Sets a
CryptoKeyReader. |
ProducerBuilder<T> |
ProducerBuilder.defaultCryptoKeyReader(Map<String,String> publicKeys)
Sets the default implementation of
CryptoKeyReader. |
ProducerBuilder<T> |
ProducerBuilder.defaultCryptoKeyReader(String publicKey)
Sets the default implementation of
CryptoKeyReader. |
ProducerBuilder<T> |
ProducerBuilder.enableBatching(boolean enableBatching)
Control whether automatic batching of messages is enabled for the producer.
|
ProducerBuilder<T> |
ProducerBuilder.enableChunking(boolean enableChunking)
If message size is higher than allowed max publish-payload size by broker then enableChunking helps producer to
split message into multiple chunks and publish them to broker separately and in order.
|
ProducerBuilder<T> |
ProducerBuilder.enableMultiSchema(boolean multiSchema)
Control whether enable the multiple schema mode for producer.
|
ProducerBuilder<T> |
ProducerBuilder.hashingScheme(HashingScheme hashingScheme)
Change the
HashingScheme used to chose the partition on where to publish a particular message. |
ProducerBuilder<T> |
ProducerBuilder.initialSequenceId(long initialSequenceId)
Set the baseline for the sequence ids for messages published by the producer.
|
ProducerBuilder<T> |
ProducerBuilder.intercept(ProducerInterceptor... interceptors)
Add a set of
ProducerInterceptor to the producer. |
ProducerBuilder<T> |
ProducerBuilder.intercept(ProducerInterceptor<T>... interceptors)
Deprecated.
|
ProducerBuilder<T> |
ProducerBuilder.loadConf(Map<String,Object> config)
Load the configuration from provided config map.
|
ProducerBuilder<T> |
ProducerBuilder.maxPendingMessages(int maxPendingMessages)
Set the max size of the queue holding the messages pending to receive an acknowledgment from the broker.
|
ProducerBuilder<T> |
ProducerBuilder.maxPendingMessagesAcrossPartitions(int maxPendingMessagesAcrossPartitions)
Set the number of max pending messages across all the partitions.
|
ProducerBuilder<T> |
ProducerBuilder.messageRouter(MessageRouter messageRouter)
Set a custom message routing policy by passing an implementation of MessageRouter.
|
ProducerBuilder<T> |
ProducerBuilder.messageRoutingMode(MessageRoutingMode messageRoutingMode)
Set the
MessageRoutingMode for a partitioned producer. |
ProducerBuilder<byte[]> |
PulsarClient.newProducer()
Create a producer builder that can be used to configure
and construct a producer with default
Schema.BYTES. |
<T> ProducerBuilder<T> |
PulsarClient.newProducer(Schema<T> schema)
Create a producer builder that can be used to configure
and construct a producer with the specified schema.
|
ProducerBuilder<T> |
ProducerBuilder.producerName(String producerName)
Specify a name for the producer.
|
ProducerBuilder<T> |
ProducerBuilder.properties(Map<String,String> properties)
Add all the properties in the provided map to the producer.
|
ProducerBuilder<T> |
ProducerBuilder.property(String key,
String value)
Set a name/value property with this producer.
|
ProducerBuilder<T> |
ProducerBuilder.roundRobinRouterBatchingPartitionSwitchFrequency(int frequency)
Set the partition switch frequency while batching of messages is enabled and
using round-robin routing mode for non-keyed message default: 10.
|
ProducerBuilder<T> |
ProducerBuilder.sendTimeout(int sendTimeout,
TimeUnit unit)
Set the send timeout (default: 30 seconds).
|
ProducerBuilder<T> |
ProducerBuilder.topic(String topicName)
Specify the topic this producer will be publishing on.
|
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.