This is an automated email from the ASF dual-hosted git repository.
liuyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 30f3dda [Doc] Add docs for multiple host in Go client (#10037)
30f3dda is described below
commit 30f3ddab9e1bf36f8361c3e58a468cda9a9c0b99
Author: Yu Liu <[email protected]>
AuthorDate: Fri Mar 26 07:23:04 2021 +0800
[Doc] Add docs for multiple host in Go client (#10037)
* [Doc] Add contents of multiple host for Go client
* update
* update
Co-authored-by: Anonymitaet <anonymitaet_hotmail.com>
---
site2/docs/client-libraries-go.md | 31 +++++++++++++++++++++-
site2/docs/reference-cli-tools.md | 1 +
site2/docs/reference-configuration.md | 1 +
.../version-2.7.1/admin-api-overview.md | 8 +++---
.../version-2.7.1/cookbooks-message-queue.md | 22 +++++++++++++++
.../version-2.7.1/functions-worker.md | 1 +
.../versioned_sidebars/version-2.7.1-sidebars.json | 1 -
7 files changed, 59 insertions(+), 6 deletions(-)
diff --git a/site2/docs/client-libraries-go.md
b/site2/docs/client-libraries-go.md
index 2152a25..96c94b3 100644
--- a/site2/docs/client-libraries-go.md
+++ b/site2/docs/client-libraries-go.md
@@ -38,6 +38,12 @@ Pulsar protocol URLs are assigned to specific clusters, use
the `pulsar` scheme
pulsar://localhost:6650
```
+If you have multiple brokers, you can set the URL as below.
+
+```
+pulsar://localhost:6550,localhost:6651,localhost:6652
+```
+
A URL for a production Pulsar cluster may look something like this:
```http
@@ -77,11 +83,34 @@ func main() {
}
```
+If you have multiple brokers, you can initiate a client object as below.
+
+```
+import (
+ "log"
+ "time"
+ "github.com/apache/pulsar-client-go/pulsar"
+)
+
+func main() {
+ client, err := pulsar.NewClient(pulsar.ClientOptions{
+ URL: "pulsar://localhost:6650,localhost:6651,localhost:6652",
+ OperationTimeout: 30 * time.Second,
+ ConnectionTimeout: 30 * time.Second,
+ })
+ if err != nil {
+ log.Fatalf("Could not instantiate Pulsar client: %v", err)
+ }
+
+ defer client.Close()
+}
+```
+
The following configurable parameters are available for Pulsar clients:
Name | Description | Default
| :-------- | :---------- |:---------- |
-| URL | Configure the service URL for the Pulsar service. This parameter is
required | |
+| URL | Configure the service URL for the Pulsar service.<br><br>If you have
multiple brokers, you can set multiple Pulsar cluster addresses for a client.
<br><br>This parameter is **required**. |None |
| ConnectionTimeout | Timeout for the establishment of a TCP connection | 30s |
| OperationTimeout| Set the operation timeout. Producer-create, subscribe and
unsubscribe operations will be retried until this interval, after which the
operation will be marked as failed| 30s|
| Authentication | Configure the authentication provider. Example:
`Authentication: NewAuthenticationTLS("my-cert.pem", "my-key.pem")` | no
authentication |
diff --git a/site2/docs/reference-cli-tools.md
b/site2/docs/reference-cli-tools.md
index 59fc09a..cb35fe7 100644
--- a/site2/docs/reference-cli-tools.md
+++ b/site2/docs/reference-cli-tools.md
@@ -298,6 +298,7 @@ Options
|`--auth-plugin`|Authentication plugin class
name|org.apache.pulsar.client.impl.auth.AuthenticationSasl|
|`--listener-name`|Listener name for the broker||
|`--url`|Broker URL to which to connect|pulsar://localhost:6650/ </br>
ws://localhost:8080 |
+| `-v`, `--version` | Get the version of the Pulsar client
### `produce`
diff --git a/site2/docs/reference-configuration.md
b/site2/docs/reference-configuration.md
index e643600..cbac5b6 100644
--- a/site2/docs/reference-configuration.md
+++ b/site2/docs/reference-configuration.md
@@ -189,6 +189,7 @@ Pulsar brokers are responsible for handling incoming
messages from producers, di
|forceDeleteNamespaceAllowed| Enable you to delete a namespace forcefully.
|false|
|messageExpiryCheckIntervalInMinutes| The frequency of proactively checking
and purging expired messages. |5|
|brokerServiceCompactionMonitorIntervalInSeconds| Interval between checks to
determine whether topics with compaction policies need compaction. |60|
+brokerServiceCompactionThresholdInBytes|If the estimated backlog size is
greater than this threshold, compression is triggered.<br><br>Set this
threshold to 0 means disabling the compression check.|N/A
|delayedDeliveryEnabled| Whether to enable the delayed delivery for messages.
If disabled, messages will be immediately delivered and there will be no
tracking overhead.|true|
|delayedDeliveryTickTimeMillis|Control the tick time for retrying on delayed
delivery, which affects the accuracy of the delivery time compared to the
scheduled time. By default, it is 1 second.|1000|
|activeConsumerFailoverDelayTimeMillis| How long to delay rewinding cursor and
dispatching messages when active consumer is changed. |1000|
diff --git a/site2/website/versioned_docs/version-2.7.1/admin-api-overview.md
b/site2/website/versioned_docs/version-2.7.1/admin-api-overview.md
index 80ee07b..1395585 100644
--- a/site2/website/versioned_docs/version-2.7.1/admin-api-overview.md
+++ b/site2/website/versioned_docs/version-2.7.1/admin-api-overview.md
@@ -14,11 +14,11 @@ You can currently interact with the admin interface via:
to handle redirections.
- The `pulsar-admin` CLI tool, which is available in the `bin` folder of your
[Pulsar installation](getting-started-standalone.md):
-```shell
-$ bin/pulsar-admin
-```
+ ```shell
+ $ bin/pulsar-admin
+ ```
-Full documentation for this tool can be found in the [Pulsar command-line
tools](reference-pulsar-admin.md) doc.
+ For the complete commands and descriptions of `pulsar-admin`, see
[here](http://pulsar.apache.org/tools/pulsar-admin/2.7.0-SNAPSHOT/).
- A Java client interface.
diff --git
a/site2/website/versioned_docs/version-2.7.1/cookbooks-message-queue.md
b/site2/website/versioned_docs/version-2.7.1/cookbooks-message-queue.md
index 06c25f1..902bc7c 100644
--- a/site2/website/versioned_docs/version-2.7.1/cookbooks-message-queue.md
+++ b/site2/website/versioned_docs/version-2.7.1/cookbooks-message-queue.md
@@ -93,3 +93,25 @@ Consumer consumer;
Result result = client.subscribe(topic, subscription, consumerConfig,
consumer);
```
+## Go clients
+
+Here is an example of a Go consumer configuration that uses the shared
subscription.
+
+```go
+import "github.com/apache/pulsar-client-go/pulsar"
+client, err := pulsar.NewClient(pulsar.ClientOptions{
+ URL: "pulsar://localhost:6650",
+})
+if err != nil {
+ log.Fatal(err)
+}
+consumer, err := client.Subscribe(pulsar.ConsumerOptions{
+ Topic: "persistent://public/default/mq-topic-1",
+ SubscriptionName: "sub-1",
+ Type: pulsar.Shared,
+ ReceiverQueueSize: 10, // If you'd like to restrict the receiver queue size
+})
+if err != nil {
+ log.Fatal(err)
+}
+```
\ No newline at end of file
diff --git a/site2/website/versioned_docs/version-2.7.1/functions-worker.md
b/site2/website/versioned_docs/version-2.7.1/functions-worker.md
index e6f88ed..beb2eab 100644
--- a/site2/website/versioned_docs/version-2.7.1/functions-worker.md
+++ b/site2/website/versioned_docs/version-2.7.1/functions-worker.md
@@ -36,6 +36,7 @@ Pay attention to the following required settings when
configuring functions-work
- `numFunctionPackageReplicas`: The number of replicas to store function
packages. The default value is `1`, which is good for standalone deployment.
For production deployment, to ensure high availability, set it to be larger
than `2`.
- `pulsarFunctionsCluster`: Set the value to your Pulsar cluster name (same as
the `clusterName` setting in the broker configuration).
+- `initializedDlogMetadata`: Whether to initialize distributed log metadata in
runtime. If it is set to `true`, you must ensure that it has been initialized
by `bin/pulsarinitialize-cluster-metadata` command.
If authentication is enabled on the BookKeeper cluster, configure the
following BookKeeper authentication settings.
diff --git a/site2/website/versioned_sidebars/version-2.7.1-sidebars.json
b/site2/website/versioned_sidebars/version-2.7.1-sidebars.json
index 7325df2..15bb01e 100644
--- a/site2/website/versioned_sidebars/version-2.7.1-sidebars.json
+++ b/site2/website/versioned_sidebars/version-2.7.1-sidebars.json
@@ -150,7 +150,6 @@
"Reference": [
"version-2.7.1-reference-terminology",
"version-2.7.1-reference-cli-tools",
- "version-2.7.1-pulsar-admin",
"version-2.7.1-reference-configuration",
"version-2.7.1-reference-metrics"
]