You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ni...@apache.org on 2022/06/16 15:12:20 UTC
[pulsar] branch master updated: [doc] Transactions: fix code samples indentation (#16093)
This is an automated email from the ASF dual-hosted git repository.
nicoloboschi 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 bb0bfb904da [doc] Transactions: fix code samples indentation (#16093)
bb0bfb904da is described below
commit bb0bfb904da90030c171ceac0159142d2bdb51b7
Author: Nicolò Boschi <bo...@gmail.com>
AuthorDate: Thu Jun 16 17:12:11 2022 +0200
[doc] Transactions: fix code samples indentation (#16093)
* [doc] Transactions: fix code samples indentantion
* Update txn-use.md
---
site2/docs/txn-use.md | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/site2/docs/txn-use.md b/site2/docs/txn-use.md
index a8f21b766a5..8a90a42c219 100644
--- a/site2/docs/txn-use.md
+++ b/site2/docs/txn-use.md
@@ -69,12 +69,9 @@ This section provides an example of how to use the transaction API to send and r
```
PulsarClient client = PulsarClient.builder()
-
- .serviceUrl(“pulsar://localhost:6650”)
-
- .enableTransaction(true)
-
- .build();
+ .serviceUrl(“pulsar://localhost:6650”)
+ .enableTransaction(true)
+ .build();
```
@@ -96,12 +93,11 @@ Let’s walk through this example step by step.
```
-Consumer<byte[]> sinkConsumer = pulsarClient
+Consumer<byte[]> consumer = pulsarClient
.newConsumer()
.topic(transferTopic)
- .subscriptionName("sink-topic")
-
-.subscriptionInitialPosition(SubscriptionInitialPosition.Earliest)
+ .subscriptionName("transaction-sub")
+ .subscriptionInitialPosition(SubscriptionInitialPosition.Earliest)
.subscriptionType(SubscriptionType.Shared)
.enableBatchIndexAcknowledgment(true) // enable batch index acknowledgement
.subscribe();