Anonymitaet commented on code in PR #501: URL: https://github.com/apache/pulsar-site/pull/501#discussion_r1156675904
########## docs/txn-advanced-features.md: ########## @@ -0,0 +1,45 @@ +--- +id: txn-advanced-features +title: Advanced features +sidebar_label: "Advanced features" +--- + +You can use the following advanced features with transactions in Pulsar. + +## Ack batch messages + +If you want to acknowledge batch messages with transactions, set `acknowledgmentAtBatchIndexLevelEnabled` to `true` in the [`broker.conf`](https://github.com/apache/pulsar/blob/master/conf/broker.conf) or [`standalone.conf`](https://github.com/apache/pulsar/blob/master/conf/standalone.conf) file. + + +```conf +acknowledgmentAtBatchIndexLevelEnabled=true +``` + +This example enables batch messages ack in transactions in the consumer builder. + +```java +Consumer<byte[]> consumer = pulsarClient + .newConsumer() + .topic(transferTopic) + .subscriptionName("transaction-sub") + .subscriptionInitialPosition(SubscriptionInitialPosition.Earliest) + .subscriptionType(SubscriptionType.Shared) + .enableBatchIndexAcknowledgment(true) // enable batch index acknowledgment + .subscribe(); +``` + +## Enable authentication Review Comment: @congbobo184 double check: can users enable OAuth2 auth only or all methods? <img width="277" alt="image" src="https://user-images.githubusercontent.com/50226895/229676347-33e15be8-17b5-451e-8bc3-a95c7d0e3584.png"> -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
