Parameter | Description | Default | Configuration Suggestions |
topicName | Sending Message Topic | None | Required, user-customized. |
producerName | Producer Name. | Cluster name - random character | Retain the default settings. Do not set. |
sendTimeoutMs | Sending timeout. | 30s | It is recommended that users adjust according to the actual situation. Usually, it is recommended that users set the timeout period to at least 5 s or more (for non-exclusive clusters, it is recommended to set it to 10 s or more) to prevent occasional network jitter from impacting the sending success rate. |
maxPendingMessages | Max send queue length of messages. | 1000 | Retain the default settings. |
maxPendingMessagesAcrossPartitions | Max send queue length of messages for all partitions. | 50000 | Retain the default settings. |
blockIfQueueFull | Whether the system will be blocked after the message send queue is full. | false | Retain the default settings. |
messageRoutingMode | Message routing mode. | pulsar.RoundRobinDistribution | Retain the default settings. |
hashingScheme | hash mode. | HashingScheme.JavaStringHash | Retain the default settings. |
CompressionType | Compression type, default no compression. | No compression | Retain the default settings. |
batchingEnabled | Whether batch sending is enabled. | true | In online scenarios, it is recommended to change to false to disable batch sending.Batch sending can cause delayed message delivery, message filtering and other features to fail. |
batchingMaxPublishDelayMicros | Maximum waiting time for batch sending. | TimeUnit.MILLISECONDS.toMicros(1) | If batch sending is adopted, it is recommended to adjust to more than 10 ms. This threshold is too small and can lead to an increase in producer cpu load. |
batchingMaxMessages | Maximum number of messages in a single batch send. | 1000 | Retain the default settings. |
batchingMaxBytes | Max message length in a single batch send. | 128k | Retain the default settings. |
Parameters | Description | Default Value | Recommendation |
topicNames | Name list of subscribed topics. | None | Required, user-customized. |
topicsPattern | Subscription topic pattern matching. | None | Retain the default settings. |
subscriptionName | Subscription name. | None | Required, user-customized. |
subscriptionType | Subscription type. | SubscriptionType.Exclusive | SubscriptionType.Shared, required. It is advisable to give priority to the Shared consumption mode in production. |
receiverQueueSize | Receive queue length. | 1000 | Retain the default settings. |
acknowledgementsGroupTimeMicros | The batch waiting time of an ack request is set too low, which will cause a decline in the overall cluster performance. | 100ms | Retain the default settings. |
negativeAckRedeliveryDelayMicros | Call the nack API. How long after will the message be retransmitted (if the corresponding consumer instance restarts or goes down after unack, the message will be retransmitted immediately). | 1min | Retain the default settings. |
maxTotalReceiverQueueSizeAcrossPartitions | The length of the entire message receive queue. | 50000 | Retain the default settings. |
consumerName | Consumer Name. | Cluster name - random character | Retain the default settings. Do not set. |
ackTimeoutMillis | ack timeout period. After exceeding the threshold, the message will be reconsumed. 0 means no timeout period. | 0 | Retain the default settings. |
priorityLevel | Consumer priority. The server will preferentially push messages to consumer instances with high priority. The smaller the number, the higher the priority. 0 represents the highest priority. | 0 | Retain the default settings. |
properties | Consumer configuration for the server to query and display. Set filter rules for tags and message filtering in this field. | None | Retain the default settings. |
subscriptionInitialPosition | Initialize the subscription position, the position where the consumer first consumes. By default, start consuming from the most recent location. Messages sent by the topic before starting to consume will not be consumed. | SubscriptionInitialPosition.Latest | Retain the default settings. |
patternAutoDiscoveryPeriod | Automatically perceive the interval for changes in the number of partitions. Internally retrieve the partition metadata of topics periodically and timely perceive the scale-out of topics. | 1min | Retain the default settings. |
regexSubscriptionMode | There are three modes for topic subscriptions: subscribing to persistent topics, subscribing to non-persistent topics, and subscribing to all types of topics. By default, subscribe to persistent topics. | RegexSubscriptionMode.PersistentOnly | Retain the default settings. |
retryEnable | Whether to enable retry feature. | false | Keep the default. Select as needed. Refer to the retry and dead letter features. |
deadLetterPolicy | Retry and dead letter policy. | None | Keep the default. Select as needed. Refer to the retry and dead letter features. |
autoUpdatePartitions | Auto-update partitions. | true | Retain the default settings. |
replicateSubscriptionState | After enabling cross-cluster synchronization, whether to synchronize consumption progress. | false | Retain the default settings. |