This is an automated email from the ASF dual-hosted git repository. tison pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
The following commit(s) were added to refs/heads/main by this push: new 330fdbc7e69 [fix][doc] Links and tables (#480) 330fdbc7e69 is described below commit 330fdbc7e6913b45b4f4d1baa9f5f7add7a24b09 Author: tison <wander4...@gmail.com> AuthorDate: Tue Mar 21 18:05:37 2023 +0800 [fix][doc] Links and tables (#480) Signed-off-by: tison <wander4...@gmail.com> --- docs/client-libraries-java-configs.md | 184 ++++++++++++++++----------------- docs/concepts-architecture-overview.md | 1 - 2 files changed, 92 insertions(+), 93 deletions(-) diff --git a/docs/client-libraries-java-configs.md b/docs/client-libraries-java-configs.md index 379f4b4c4c8..206ea7d8434 100644 --- a/docs/client-libraries-java-configs.md +++ b/docs/client-libraries-java-configs.md @@ -8,36 +8,36 @@ sidebar_label: "Java client" If you create a Java client, you can use the `loadConf` configuration. The following parameters are available in `loadConf`. -| Name | Type | <div>Description</div> | Default -|---|---|---|--- -`serviceUrl` | String | Service URL provider for Pulsar service | None -`authPluginClassName` | String | Name of the authentication plugin | None - `authParams` | String | Parameters for the authentication plugin <br /><br />**Example**<br /> key1:val1,key2:val2|None -`operationTimeoutMs`|long|`operationTimeoutMs`|Operation timeout |30000 -`statsIntervalSeconds`|long|Interval between each stats information<br /><br />Stats is activated with positive `statsInterval`<br /><br />Set `statsIntervalSeconds` to 1 second at least. |60 -`numIoThreads`| int| The number of threads used for handling connections to brokers | 1 -`numListenerThreads`|int|The number of threads used for handling message listeners. The listener thread pool is shared across all the consumers and readers using the "listener" model to get messages. For a given consumer, the listener is always invoked from the same thread to ensure ordering. If you want multiple threads to process a single topic, you need to create a [`shared`](/concepts-messaging.md#shared) subscription and multiple consumers for this subscription. This does not ensure [...] -`useTcpNoDelay`| boolean| Whether to use TCP no-delay flag on the connection to disable Nagle algorithm |true -`enableTls` |boolean | Whether to use TLS encryption on the connection. Note that this parameter is **deprecated**. If you want to enable TLS, use `pulsar+ssl://` in `serviceUrl` instead. | false - `tlsTrustCertsFilePath` |string |Path to the trusted TLS certificate file|None -`tlsAllowInsecureConnection`|boolean|Whether the Pulsar client accepts untrusted TLS certificate from broker | false -`tlsHostnameVerificationEnable` |boolean | Whether to enable TLS hostname verification|false -`concurrentLookupRequest`|int|The number of concurrent lookup requests allowed to send on each broker connection to prevent overload on broker|5000 -`maxLookupRequest`|int|The maximum number of lookup requests allowed on each broker connection to prevent overload on broker | 50000 -`maxNumberOfRejectedRequestPerConnection`|int|The maximum number of rejected requests of a broker in a certain time frame (60 seconds) after the current connection is closed and the client creates a new connection to connect to a different broker|50 -`keepAliveIntervalSeconds`|int|Seconds of keeping alive interval for each client broker connection|30 -`connectionTimeoutMs`|int|Duration of waiting for a connection to a broker to be established <br /><br />If the duration passes without a response from a broker, the connection attempt is dropped|10000 -`requestTimeoutMs`|int|Maximum duration for completing a request |60000 -`defaultBackoffIntervalNanos`|int| Default duration for a backoff interval | TimeUnit.MILLISECONDS.toNanos(100); -`maxBackoffIntervalNanos`|long|Maximum duration for a backoff interval|TimeUnit.SECONDS.toNanos(30) -`socks5ProxyAddress`|SocketAddress|SOCKS5 proxy address | None -`socks5ProxyUsername`|string|SOCKS5 proxy username | None -`socks5ProxyPassword`|string|SOCKS5 proxy password | None -`connectionMaxIdleSeconds`|int|Release the connection if it is not used for more than `connectionMaxIdleSeconds` seconds.If `connectionMaxIdleSeconds` < 0, disabled the feature that auto release the idle connection|180 +| Name | Type | Description [...] +|-------------------------------------------|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...] +| `serviceUrl` | String | Service URL provider for Pulsar service [...] +| `authPluginClassName` | String | Name of the authentication plugin [...] +| `authParams` | String | Parameters for the authentication plugin <br /><br />**Example**<br /> key1:val1,key2:val2 [...] +| `operationTimeoutMs` | long | Operation timeout [...] +| `statsIntervalSeconds` | long | Interval between each stats information<br /><br />Stats is activated with positive `statsInterval`<br /><br />Set `statsIntervalSeconds` to 1 second at least. [...] +| `numIoThreads` | int | The number of threads used for handling connections to brokers [...] +| `numListenerThreads` | int | The number of threads used for handling message listeners. The listener thread pool is shared across all the consumers and readers using the "listener" model to get messages. For a given consumer, the listener is always invoked from the same thread to ensure ordering. If you want multiple threads to process a single topic, you need to create a [`shared`](concepts-messaging.md#shared) subscription and multiple consumers for thi [...] +| `useTcpNoDelay` | boolean | Whether to use TCP no-delay flag on the connection to disable Nagle algorithm [...] +| `enableTls` | boolean | Whether to use TLS encryption on the connection. Note that this parameter is **deprecated**. If you want to enable TLS, use `pulsar+ssl://` in `serviceUrl` instead. [...] +| `tlsTrustCertsFilePath` | string | Path to the trusted TLS certificate file [...] +| `tlsAllowInsecureConnection` | boolean | Whether the Pulsar client accepts untrusted TLS certificate from broker [...] +| `tlsHostnameVerificationEnable` | boolean | Whether to enable TLS hostname verification [...] +| `concurrentLookupRequest` | int | The number of concurrent lookup requests allowed to send on each broker connection to prevent overload on broker [...] +| `maxLookupRequest` | int | The maximum number of lookup requests allowed on each broker connection to prevent overload on broker [...] +| `maxNumberOfRejectedRequestPerConnection` | int | The maximum number of rejected requests of a broker in a certain time frame (60 seconds) after the current connection is closed and the client creates a new connection to connect to a different broker [...] +| `keepAliveIntervalSeconds` | int | Seconds of keeping alive interval for each client broker connection [...] +| `connectionTimeoutMs` | int | Duration of waiting for a connection to a broker to be established <br /><br />If the duration passes without a response from a broker, the connection attempt is dropped [...] +| `requestTimeoutMs` | int | Maximum duration for completing a request [...] +| `defaultBackoffIntervalNanos` | int | Default duration for a backoff interval [...] +| `maxBackoffIntervalNanos` | long | Maximum duration for a backoff interval [...] +| `socks5ProxyAddress` | SocketAddress | SOCKS5 proxy address [...] +| `socks5ProxyUsername` | string | SOCKS5 proxy username [...] +| `socks5ProxyPassword` | string | SOCKS5 proxy password [...] +| `connectionMaxIdleSeconds` | int | Release the connection if it is not used for more than `connectionMaxIdleSeconds` seconds.If `connectionMaxIdleSeconds` < 0, disabled the feature that auto release the idle connection [...] In addition to client-level configuration, you can also apply [producer](#producer-configs) and [consumer](#consumer-configs) specific configurations. -For a full list of configurable parameters, check out the Javadoc for the {@inject: javadoc:PulsarClient:/client/org/apache/pulsar/client/api/PulsarClient} class. +For a full list of configurable parameters, check out the Javadoc for the [PulsarClient](/api/client/org/apache/pulsar/client/api/PulsarClient) class. ## Producer configs @@ -45,23 +45,23 @@ If you instantiate a `Producer` object by specifying only a topic name as the ex If you create a producer, you can use the `loadConf` configuration. The following parameters are available in `loadConf`. -Name| Type | <div>Description</div>| Default -|---|---|---|--- -`topicName`| string| Topic name| null| -`producerName`| string|Producer name| null -`sendTimeoutMs`| long|Message send timeout in ms.<br />If a message is not acknowledged by a server before the `sendTimeout` expires, an error occurs.|30000 -`blockIfQueueFull`|boolean|If it is set to `true`, when the outgoing message queue is full, the `Send` and `SendAsync` methods of producer block, rather than failing and throwing errors. <br />If it is set to `false`, when the outgoing message queue is full, the `Send` and `SendAsync` methods of producer fail and `ProducerQueueIsFullError` exceptions occur.<br /><br />The `MaxPendingMessages` parameter determines the size of the outgoing message queue.|false -`maxPendingMessages`| int|The maximum size of a queue holding pending messages.<br /><br />For example, a message waiting to receive an acknowledgment from a [broker](reference-terminology.md#broker). <br /><br />By default, when the queue is full, all calls to the `Send` and `SendAsync` methods fail **unless** you set `BlockIfQueueFull` to `true`.|1000 -`maxPendingMessagesAcrossPartitions`|int|Deprecated, use `memoryLimit` instead. The maximum number of pending messages across partitions. <br /><br />Use the setting to lower the max pending messages for each partition ({@link #setMaxPendingMessages(int)}) if the total number exceeds the configured value and maxPendingMessagesAcrossPartitions needs to be >= maxPendingMessages.|50000 -`messageRoutingMode`| MessageRoutingMode|Message routing logic for producers on [partitioned topics](concepts-architecture-overview.md#partitioned-topics).<br /> Apply the logic only when setting no key on messages. <br />Available options are as follows: <br /><li>`pulsar.RoundRobinDistribution`: round robin</li><li>`pulsar.UseSinglePartition`: publish all messages to a single partition</li><li>`pulsar.CustomPartition`: a custom partitioning scheme</li>|<li>`pulsar.RoundRobinDistribution`</li> -`hashingScheme`| HashingScheme|Hashing function determining the partition where you publish a particular message (**partitioned topics only**).<br />Available options are as follows:<br /><li> `pulsar.JavastringHash`: the equivalent of `string.hashCode()` in Java</li><li> `pulsar.Murmur3_32Hash`: applies the [Murmur3](https://en.wikipedia.org/wiki/MurmurHash) hashing function</li><li>`pulsar.BoostHash`: applies the hashing function from C++'s [Boost](https://www.boost.org/doc/libs/1_62_0 [...] -`cryptoFailureAction`| ProducerCryptoFailureAction|Producer should take action when encryption fails.<br /><li>**FAIL**: if encryption fails, unencrypted messages fail to send.</li><li> **SEND**: if encryption fails, unencrypted messages are sent.</li> |`ProducerCryptoFailureAction.FAIL` -`batchingMaxPublishDelayMicros`| long|Batching time period of sending messages.|TimeUnit.MILLISECONDS.toMicros(1) -`batchingMaxMessages` |int|The maximum number of messages permitted in a batch.|1000 -`batchingEnabled`| boolean|Enable batching of messages. |true -`chunkingEnabled` | boolean | Enable chunking of messages. |false -`compressionType`|CompressionType|Message data compression type used by a producer. <br />Available options:<li>[`LZ4`](https://github.com/lz4/lz4)</li><li>[`ZLIB`](https://zlib.net/)<br /></li><li>[`ZSTD`](https://facebook.github.io/zstd/)</li><li>[`SNAPPY`](https://google.github.io/snappy/)</li>| No compression -`initialSubscriptionName`|string|Use this configuration to automatically create an initial subscription when creating a topic. If this field is not set, the initial subscription is not created.|null +| Name | Type | Description [...] +|--------------------------------------|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...] +| `topicName` | string | Topic name [...] +| `producerName` | string | Producer name [...] +| `sendTimeoutMs` | long | Message send timeout in ms.<br />If a message is not acknowledged by a server before the `sendTimeout` expires, an error occurs. [...] +| `blockIfQueueFull` | boolean | If it is set to `true`, when the outgoing message queue is full, the `Send` and `SendAsync` methods of producer block, rather than failing and throwing errors. <br />If it is set to `false`, when the outgoing message queue is full, the `Send` and `SendAsync` methods of producer fail and `ProducerQueueIsFullError` exceptions occur.<br /><br />The `MaxPendingMessages` parameter determines the size of the outgoing messag [...] +| `maxPendingMessages` | int | The maximum size of a queue holding pending messages.<br /><br />For example, a message waiting to receive an acknowledgment from a [broker](reference-terminology.md#broker). <br /><br />By default, when the queue is full, all calls to the `Send` and `SendAsync` methods fail **unless** you set `BlockIfQueueFull` to `true`. [...] +| `maxPendingMessagesAcrossPartitions` | int | Deprecated, use `memoryLimit` instead. The maximum number of pending messages across partitions. <br /><br />Use the setting to lower the max pending messages for each partition ({@link #setMaxPendingMessages(int)}) if the total number exceeds the configured value and maxPendingMessagesAcrossPartitions needs to be >= maxPendingMessages. [...] +| `messageRoutingMode` | MessageRoutingMode | Message routing logic for producers on [partitioned topics](concepts-messaging.md#partitioned-topics).<br /> Apply the logic only when setting no key on messages. <br />Available options are as follows: <br /><li>`pulsar.RoundRobinDistribution`: round robin</li><li>`pulsar.UseSinglePartition`: publish all messages to a single partition</li><li>`pulsar.CustomPartition`: a custom partitioning scheme</li> [...] +| `hashingScheme` | HashingScheme | Hashing function determining the partition where you publish a particular message (**partitioned topics only**).<br />Available options are as follows:<br /><li> `pulsar.JavastringHash`: the equivalent of `string.hashCode()` in Java</li><li> `pulsar.Murmur3_32Hash`: applies the [Murmur3](https://en.wikipedia.org/wiki/MurmurHash) hashing function</li><li>`pulsar.BoostHash`: applies the hashing function from C++'s [Boos [...] +| `cryptoFailureAction` | ProducerCryptoFailureAction | Producer should take action when encryption fails.<br /><li>**FAIL**: if encryption fails, unencrypted messages fail to send.</li><li> **SEND**: if encryption fails, unencrypted messages are sent.</li> [...] +| `batchingMaxPublishDelayMicros` | long | Batching time period of sending messages. [...] +| `batchingMaxMessages` | int | The maximum number of messages permitted in a batch. [...] +| `batchingEnabled` | boolean | Enable batching of messages. [...] +| `chunkingEnabled` | boolean | Enable chunking of messages. [...] +| `compressionType` | CompressionType | Message data compression type used by a producer. <br />Available options:<li>[`LZ4`](https://github.com/lz4/lz4)</li><li>[`ZLIB`](https://zlib.net/)<br /></li><li>[`ZSTD`](https://facebook.github.io/zstd/)</li><li>[`SNAPPY`](https://google.github.io/snappy/)</li> [...] +| `initialSubscriptionName` | string | Use this configuration to automatically create an initial subscription when creating a topic. If this field is not set, the initial subscription is not created. [...] You can configure parameters if you do not want to use the default configuration. @@ -82,35 +82,35 @@ If you instantiate a `Consumer` object by specifying only a topic and subscripti When you create a consumer, you can use the `loadConf` configuration. The following parameters are available in `loadConf`. - Name|Type | <div>Description</div>| Default -|---|---|---|--- -`topicNames`| Set<String>| Topic name| Sets.newTreeSet() - `topicsPattern`|Pattern| Topic pattern |None -`subscriptionName`|String| Subscription name| None -`subscriptionType`|SubscriptionType| Subscription type <br />Four subscription types are available:<li>Exclusive</li><li>Failover</li><li>Shared</li><li>Key_Shared</li>|SubscriptionType.Exclusive -`receiverQueueSize` |int | Size of a consumer's receiver queue. <br /><br />For example, the number of messages accumulated by a consumer before an application calls `Receive`. <br /><br />A value higher than the default value increases consumer throughput, though at the expense of more memory utilization.| 1000 -`acknowledgementsGroupTimeMicros`|long|Group a consumer acknowledgment for a specified time.<br /><br />By default, a consumer uses 100ms grouping time to send out acknowledgments to a broker.<br /><br />Setting a group time of 0 sends out acknowledgments immediately. <br /><br />A longer ack group time is more efficient at the expense of a slight increase in message re-deliveries after a failure.|TimeUnit.MILLISECONDS.toMicros(100) -`negativeAckRedeliveryDelayMicros`|long|Delay to wait before redelivering messages that failed to be processed.<br /><br /> When an application uses {@link Consumer#negativeAcknowledge(Message)}, failed messages are redelivered after a fixed timeout. |TimeUnit.MINUTES.toMicros(1) -`maxTotalReceiverQueueSizeAcrossPartitions`|int |The max total receiver queue size across partitions.<br /><br />This setting reduces the receiver queue size for individual partitions if the total receiver queue size exceeds this value.|50000 -`consumerName`|String|Consumer name|null -`ackTimeoutMillis`|long|Timeout of unacked messages|0 -`tickDurationMillis`|long|Granularity of the ack-timeout redelivery.<br /><br />Using an higher `tickDurationMillis` reduces the memory overhead to track messages when setting ack-timeout to a bigger value (for example, 1 hour).|1000 -`priorityLevel`|int|Priority level for a consumer to which a broker gives more priority while dispatching messages in Shared subscription type. It can be set at the consumer level so all topics being consumed will have the same priority level or each topic being consumed can be given a different priority level.<br /><br />The broker follows descending priorities. For example, 0=max-priority, 1, 2,...<br /><br />In Shared subscription type, the broker **first dispatches messages to the ma [...] -`cryptoFailureAction`|ConsumerCryptoFailureAction|Consumer should take action when it receives a message that can not be decrypted.<br /><li>**FAIL**: this is the default option to fail messages until crypto succeeds.</li><li> **DISCARD**:silently acknowledge and not deliver message to an application.</li><li>**CONSUME**: deliver encrypted messages to applications. It is the application's responsibility to decrypt the message.</li><br />The decompression of message fails. <br /><br />If [...] -`properties`|SortedMap<String, String>|A name or value property of this consumer.<br /><br />`properties` is application defined metadata attached to a consumer. <br /><br />When getting a topic stats, associate this metadata with the consumer stats for easier identification.|new TreeMap() -`readCompacted`|boolean|If enabling `readCompacted`, a consumer reads messages from a compacted topic rather than reading a full message backlog of a topic.<br /><br /> A consumer only sees the latest value for each key in the compacted topic, up until reaching the point in the topic message when compacting backlog. Beyond that point, send messages as normal.<br /><br />Only enabling `readCompacted` on subscriptions to persistent topics, which have a single active consumer (like failure [...] -`subscriptionInitialPosition`|SubscriptionInitialPosition|Initial position at which to set cursor when subscribing to a topic at first time.|SubscriptionInitialPosition.Latest -`patternAutoDiscoveryPeriod`|int|Topic auto discovery period when using a pattern for topic's consumer.<br /><br />The default and minimum value is 1 minute.|1 -`regexSubscriptionMode`|RegexSubscriptionMode|When subscribing to a topic using a regular expression, you can pick a certain type of topics.<br /><br /><li>**PersistentOnly**: only subscribe to persistent topics.</li><li>**NonPersistentOnly**: only subscribe to non-persistent topics.</li><li>**AllTopics**: subscribe to both persistent and non-persistent topics.</li>|RegexSubscriptionMode.PersistentOnly -`deadLetterPolicy`|DeadLetterPolicy|Dead letter policy for consumers.<br /><br />By default, some messages are probably redelivered many times, even to the extent that it never stops.<br /><br />By using the dead letter mechanism, messages have the max redelivery count. **When exceeding the maximum number of redeliveries, messages are sent to the Dead Letter Topic and acknowledged automatically**.<br /><br />You can enable the dead letter mechanism by setting `deadLetterPolicy`.<br /><br [...] -`autoUpdatePartitions`|boolean|If `autoUpdatePartitions` is enabled, a consumer subscribes to partition increasement automatically.<br /><br />**Note**: this is only for partitioned consumers.|true -`replicateSubscriptionState`|boolean|If `replicateSubscriptionState` is enabled, a subscription state is replicated to geo-replicated clusters.|false -`negativeAckRedeliveryBackoff`|RedeliveryBackoff|Interface for custom message is negativeAcked policy. You can specify `RedeliveryBackoff` for a consumer.| `MultiplierRedeliveryBackoff` -`ackTimeoutRedeliveryBackoff`|RedeliveryBackoff|Interface for custom message is ackTimeout policy. You can specify `RedeliveryBackoff` for a consumer.| `MultiplierRedeliveryBackoff` -`autoAckOldestChunkedMessageOnQueueFull`|boolean|Whether to automatically acknowledge pending chunked messages when the threashold of `maxPendingChunkedMessage` is reached. If set to `false`, these messages will be redelivered by their broker. |true -`maxPendingChunkedMessage`|int| The maximum size of a queue holding pending chunked messages. When the threshold is reached, the consumer drops pending messages to optimize memory utilization.|10 -`expireTimeOfIncompleteChunkedMessageMillis`|long|The time interval to expire incomplete chunks if a consumer fails to receive all the chunks in the specified time period. The default value is 1 minute. | 60000 -`ackReceiptEnabled`|boolean| If `ackReceiptEnabled` is enabled, ACK returns a receipt. The client got the ack receipt means the broker has processed the ack request, but if without transaction, the broker does not guarantee persistence of acknowledgments, which means the messages still have a chance to be redelivered after the broker crashes. With the transaction, the client can only get the receipt after the acknowledgments have been persistent. | false +| Name | Type | Description [...] +|----------------------------------------------|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...] +| `topicNames` | Set<String> | Topic name [...] +| `topicsPattern` | Pattern | Topic pattern [...] +| `subscriptionName` | String | Subscription name [...] +| `subscriptionType` | SubscriptionType | Subscription type <br/> Four subscription types are available:<li>Exclusive</li><li>Failover</li><li>Shared</li><li>Key_Shared</li> [...] +| `receiverQueueSize` | int | Size of a consumer's receiver queue. <br /><br />For example, the number of messages accumulated by a consumer before an application calls `Receive`. <br /><br />A value higher than the default value increases consumer throughput, though at the expense of more memory utilization. [...] +| `acknowledgementsGroupTimeMicros` | long | Group a consumer acknowledgment for a specified time.<br /><br />By default, a consumer uses 100ms grouping time to send out acknowledgments to a broker.<br /><br />Setting a group time of 0 sends out acknowledgments immediately. <br /><br />A longer ack group time is more efficient at the expense of a slight increase in message re-deliveries after a failure. [...] +| `negativeAckRedeliveryDelayMicros` | long | Delay to wait before redelivering messages that failed to be processed.<br /><br /> When an application uses {@link Consumer#negativeAcknowledge(Message)}, failed messages are redelivered after a fixed timeout. [...] +| `maxTotalReceiverQueueSizeAcrossPartitions` | int | The max total receiver queue size across partitions.<br /><br />This setting reduces the receiver queue size for individual partitions if the total receiver queue size exceeds this value. [...] +| `consumerName` | String | Consumer name [...] +| `ackTimeoutMillis` | long | Timeout of unacked messages [...] +| `tickDurationMillis` | long | Granularity of the ack-timeout redelivery.<br /><br />Using an higher `tickDurationMillis` reduces the memory overhead to track messages when setting ack-timeout to a bigger value (for example, 1 hour). [...] +| `priorityLevel` | int | Priority level for a consumer to which a broker gives more priority while dispatching messages in Shared subscription type. It can be set at the consumer level so all topics being consumed will have the same priority level or each topic being consumed can be given a different priority level.<br /><br />The broker follows descending priorities. For example, 0=max-priority, 1, 2,...<br /><br />In Shared subscrip [...] +| `cryptoFailureAction` | ConsumerCryptoFailureAction | Consumer should take action when it receives a message that can not be decrypted.<br /><li>**FAIL**: this is the default option to fail messages until crypto succeeds.</li><li> **DISCARD**:silently acknowledge and not deliver message to an application.</li><li>**CONSUME**: deliver encrypted messages to applications. It is the application's responsibility to decrypt the message.</li><br />The decompression of m [...] +| `properties` | SortedMap<String, String> | A name or value property of this consumer.<br /><br />`properties` is application defined metadata attached to a consumer. <br /><br />When getting a topic stats, associate this metadata with the consumer stats for easier identification. [...] +| `readCompacted` | boolean | If enabling `readCompacted`, a consumer reads messages from a compacted topic rather than reading a full message backlog of a topic.<br /><br /> A consumer only sees the latest value for each key in the compacted topic, up until reaching the point in the topic message when compacting backlog. Beyond that point, send messages as normal.<br /><br />Only enabling `readCompacted` on subscriptions to persistent top [...] +| `subscriptionInitialPosition` | SubscriptionInitialPosition | Initial position at which to set cursor when subscribing to a topic at first time. [...] +| `patternAutoDiscoveryPeriod` | int | Topic auto discovery period when using a pattern for topic's consumer.<br /><br />The default and minimum value is 1 minute. [...] +| `regexSubscriptionMode` | RegexSubscriptionMode | When subscribing to a topic using a regular expression, you can pick a certain type of topics.<br /><br /><li>**PersistentOnly**: only subscribe to persistent topics.</li><li>**NonPersistentOnly**: only subscribe to non-persistent topics.</li><li>**AllTopics**: subscribe to both persistent and non-persistent topics.</li> [...] +| `deadLetterPolicy` | DeadLetterPolicy | Dead letter policy for consumers.<br /><br />By default, some messages are probably redelivered many times, even to the extent that it never stops.<br /><br />By using the dead letter mechanism, messages have the max redelivery count. **When exceeding the maximum number of redeliveries, messages are sent to the Dead Letter Topic and acknowledged automatically**.<br /><br />You can enable the dead letter mechan [...] +| `autoUpdatePartitions` | boolean | If `autoUpdatePartitions` is enabled, a consumer subscribes to partition increasement automatically.<br /><br />**Note**: this is only for partitioned consumers. [...] +| `replicateSubscriptionState` | boolean | If `replicateSubscriptionState` is enabled, a subscription state is replicated to geo-replicated clusters. [...] +| `negativeAckRedeliveryBackoff` | RedeliveryBackoff | Interface for custom message is negativeAcked policy. You can specify `RedeliveryBackoff` for a consumer. [...] +| `ackTimeoutRedeliveryBackoff` | RedeliveryBackoff | Interface for custom message is ackTimeout policy. You can specify `RedeliveryBackoff` for a consumer. [...] +| `autoAckOldestChunkedMessageOnQueueFull` | boolean | Whether to automatically acknowledge pending chunked messages when the threashold of `maxPendingChunkedMessage` is reached. If set to `false`, these messages will be redelivered by their broker. [...] +| `maxPendingChunkedMessage` | int | The maximum size of a queue holding pending chunked messages. When the threshold is reached, the consumer drops pending messages to optimize memory utilization. [...] +| `expireTimeOfIncompleteChunkedMessageMillis` | long | The time interval to expire incomplete chunks if a consumer fails to receive all the chunks in the specified time period. The default value is 1 minute. [...] +| `ackReceiptEnabled` | boolean | If `ackReceiptEnabled` is enabled, ACK returns a receipt. The client got the ack receipt means the broker has processed the ack request, but if without transaction, the broker does not guarantee persistence of acknowledgments, which means the messages still have a chance to be redelivered after the broker crashes. With the transaction, the client can only get the receipt after the acknowledgments have been per [...] You can configure parameters if you do not want to use the default configuration. For a full list, see the Javadoc for the {@inject: javadoc:ConsumerBuilder:/client/org/apache/pulsar/client/api/ConsumerBuilder} class. @@ -129,29 +129,29 @@ Consumer consumer = client.newConsumer() When you create a reader, you can use the `loadConf` configuration. The following parameters are available in `loadConf`. -| Name | Type| <div>Description</div> | Default -|---|---|---|--- -`topicName`|String|Topic name. |None -`receiverQueueSize`|int|Size of a consumer's receiver queue.<br /><br />For example, the number of messages that can be accumulated by a consumer before an application calls `Receive`.<br /><br />A value higher than the default value increases consumer throughput, though at the expense of more memory utilization.|1000 -`readerListener`|ReaderListener<T>|A listener that is called for message received.|None -`readerName`|String|Reader name.|null -`subscriptionName`|String| Subscription name|When there is a single topic, the default subscription name is `"reader-" + 10-digit UUID`.<br />When there are multiple topics, the default subscription name is `"multiTopicsReader-" + 10-digit UUID`. -`subscriptionRolePrefix`|String|Prefix of subscription role. |null -`cryptoKeyReader`|CryptoKeyReader|Interface that abstracts the access to a key store.|null -`cryptoFailureAction`|ConsumerCryptoFailureAction|Consumer should take action when it receives a message that can not be decrypted.<br /><li>**FAIL**: this is the default option to fail messages until crypto succeeds.</li><li> **DISCARD**: silently acknowledge and not deliver message to an application.</li><li>**CONSUME**: deliver encrypted messages to applications. It is the application's responsibility to decrypt the message.</li><br />The message decompression fails. <br /><br />If me [...] -`readCompacted`|boolean|If enabling `readCompacted`, a consumer reads messages from a compacted topic rather than a full message backlog of a topic.<br /><br /> A consumer only sees the latest value for each key in the compacted topic, up until reaching the point in the topic message when compacting backlog. Beyond that point, send messages as normal.<br /><br />`readCompacted` can only be enabled on subscriptions to persistent topics, which have a single active consumer (for example, fa [...] -`resetIncludeHead`|boolean|If set to true, the first message to be returned is the one specified by `messageId`.<br /><br />If set to false, the first message to be returned is the one next to the message specified by `messageId`.|false +| Name | Type | Description [...] +|--------------------------|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...] +| `topicName` | String | Topic name. [...] +| `receiverQueueSize` | int | Size of a consumer's receiver queue.<br /><br />For example, the number of messages that can be accumulated by a consumer before an application calls `Receive`.<br /><br />A value higher than the default value increases consumer throughput, though at the expense of more memory utilization. [...] +| `readerListener` | ReaderListener<T> | A listener that is called for message received. [...] +| `readerName` | String | Reader name. [...] +| `subscriptionName` | String | Subscription name [...] +| `subscriptionRolePrefix` | String | Prefix of subscription role. [...] +| `cryptoKeyReader` | CryptoKeyReader | Interface that abstracts the access to a key store. [...] +| `cryptoFailureAction` | ConsumerCryptoFailureAction | Consumer should take action when it receives a message that can not be decrypted.<br /><li>**FAIL**: this is the default option to fail messages until crypto succeeds.</li><li> **DISCARD**: silently acknowledge and not deliver message to an application.</li><li>**CONSUME**: deliver encrypted messages to applications. It is the application's responsibility to decrypt the message.</li><br />The message decompression fails. <br /><b [...] +| `readCompacted` | boolean | If enabling `readCompacted`, a consumer reads messages from a compacted topic rather than a full message backlog of a topic.<br /><br /> A consumer only sees the latest value for each key in the compacted topic, up until reaching the point in the topic message when compacting backlog. Beyond that point, send messages as normal.<br /><br />`readCompacted` can only be enabled on subscriptions to persistent topics, which have a sing [...] +| `resetIncludeHead` | boolean | If set to true, the first message to be returned is the one specified by `messageId`.<br /><br />If set to false, the first message to be returned is the one next to the message specified by `messageId`. [...] ## Client memory allocator configs You can set the client memory allocator configurations through Java properties.<br /> -| Property | Type | <div>Description</div> | Default | Available values -|---|---|---|---|--- -`pulsar.allocator.pooled` | String | If set to `true`, the client uses a direct memory pool. <br /> If set to `false`, the client uses a heap memory without pool | true | <li> true </li> <li> false </li> -`pulsar.allocator.exit_on_oom` | String | Whether to exit the JVM when OOM happens | false | <li> true </li> <li> false </li> -`pulsar.allocator.leak_detection` | String | The leak detection policy for Pulsar bytebuf allocator. <li> **Disabled**: No leak detection and no overhead. </li> <li> **Simple**: Instruments 1% of the allocated buffer to track for leaks. </li> <li> **Advanced**: Instruments 1% of the allocated buffer to track for leaks, reporting stack traces of places where the buffer is used. </li> <li> **Paranoid**: Instruments 100% of the allocated buffer to track for leaks, reporting stack traces of [...] -`pulsar.allocator.out_of_memory_policy` | String | When an OOM occurs, the client throws an exception or fallbacks to heap | FallbackToHeap | <li> ThrowException </li> <li> FallbackToHeap </li> +| Property | Type | Description [...] +|-----------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...] +| `pulsar.allocator.pooled` | String | If set to `true`, the client uses a direct memory pool. <br /> If set to `false`, the client uses a heap memory without pool [...] +| `pulsar.allocator.exit_on_oom` | String | Whether to exit the JVM when OOM happens [...] +| `pulsar.allocator.leak_detection` | String | The leak detection policy for Pulsar ByteBuf allocator. <li> **Disabled**: No leak detection and no overhead. </li> <li> **Simple**: Instruments 1% of the allocated buffer to track for leaks. </li> <li> **Advanced**: Instruments 1% of the allocated buffer to track for leaks, reporting stack traces of places where the buffer is used. </li> <li> **Paranoid**: Instruments 100% of the allocated buffer to track for leaks, reporting stack tr [...] +| `pulsar.allocator.out_of_memory_policy` | String | When an OOM occurs, the client throws an exception or fallbacks to heap [...] **Example** @@ -160,4 +160,4 @@ Dpulsar.allocator.pooled=true Dpulsar.allocator.exit_on_oom=false Dpulsar.allocator.leak_detection=Disabled Dpulsar.allocator.out_of_memory_policy=ThrowException -``` \ No newline at end of file +``` diff --git a/docs/concepts-architecture-overview.md b/docs/concepts-architecture-overview.md index 377b5488f14..a8593a5e30d 100644 --- a/docs/concepts-architecture-overview.md +++ b/docs/concepts-architecture-overview.md @@ -49,7 +49,6 @@ The Pulsar metadata store maintains all the metadata of a Pulsar cluster, such a > Pulsar also supports more metadata backend services, including > [etcd](https://etcd.io/) and [RocksDB](http://rocksdb.org/) (for standalone > Pulsar only). - In a Pulsar instance: * A configuration store quorum stores configuration for tenants, namespaces, and other entities that need to be globally consistent.