You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ur...@apache.org on 2022/10/26 18:01:55 UTC
[pulsar-site] branch main updated: Docs sync done from apache/pulsar(#29461bd)
This is an automated email from the ASF dual-hosted git repository.
urfree 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 90aa8cbdff0 Docs sync done from apache/pulsar(#29461bd)
90aa8cbdff0 is described below
commit 90aa8cbdff0036e13820b79f152ab38e0a7474e8
Author: Pulsar Site Updater <de...@pulsar.apache.org>
AuthorDate: Wed Oct 26 18:01:50 2022 +0000
Docs sync done from apache/pulsar(#29461bd)
---
site2/website-next/docs/client-libraries-go.md | 28 ++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/site2/website-next/docs/client-libraries-go.md b/site2/website-next/docs/client-libraries-go.md
index 8ca9f269f5e..14b331409ce 100644
--- a/site2/website-next/docs/client-libraries-go.md
+++ b/site2/website-next/docs/client-libraries-go.md
@@ -204,6 +204,34 @@ for i := 0; i < 10; i++ {
}
```
+#### How to use chunking in producer
+
+```go
+client, err := pulsar.NewClient(pulsar.ClientOptions{
+ URL: serviceURL,
+})
+
+if err != nil {
+ log.Fatal(err)
+}
+defer client.Close()
+
+// The message chunking feature is OFF by default.
+// By default, a producer chunks the large message based on the max message size (`maxMessageSize`) configured at the broker side (for example, 5MB).
+// Client can also configure the max chunked size using the producer configuration `ChunkMaxMessageSize`.
+// Note: to enable chunking, you need to disable batching (`DisableBatching=true`) concurrently.
+producer, err := client.CreateProducer(pulsar.ProducerOptions{
+ Topic: "my-topic",
+ DisableBatching: true,
+ EnableChunking: true,
+})
+
+if err != nil {
+ log.Fatal(err)
+}
+defer producer.Close()
+```
+
#### How to use schema interface in producer
```go