You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/11/21 13:38:20 UTC

[GitHub] [pulsar] eolivelli commented on a change in pull request #8628: [docs] Add transaction API

eolivelli commented on a change in pull request #8628:
URL: https://github.com/apache/pulsar/pull/8628#discussion_r528197425



##########
File path: site2/docs/transaction-api.md
##########
@@ -0,0 +1,149 @@
+---
+id: transaction-api
+title: Transaction API(Developer Preview)
+sidebar_label: Transaction API
+---
+
+All messages in a transaction is available only to consumers after the transaction is committed. If a transaction is aborted, all the writes and acknowledgments in this transaction rollback. 
+
+Currently, Pulsar transaction is a developer preview feature. It is disabled by default. You can enable the feature and use transactions in your application in development environment.
+
+## Prerequisites
+1. To enable transactions in Pulsar, you need to configure the parameter in the `broker.conf` file.
+
+```
+transactionCoordinatorEnabled=true
+```
+
+2. Initialize transaction coordinator metadata, so the transaction coordinators can leverage advantages of the partitioned topic, such as load balance.
+
+```
+bin/pulsar initialize-transaction-coordinator-metadata -cs 127.0.0.1:2181 -c standalone
+```
+
+After initializing transaction coordinator metadata, you can use the transactions API. The following APIs are available.
+
+## Initialize Pulsar client 
+
+You can enable transaction for transaction client and initialize transaction coordinator client.
+
+```
+PulsarClient pulsarClient = PulsarClient.builder()
+        .serviceUrl("pulsar://localhost:6650")
+        .enableTransaction(true)

Review comment:
       @codelipenghui @sijie @jiazhai @rdhabalia  
   is this a typo ?
   I suggest to change this to "enableTransactions", I feel it sounds better in English language
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org