visortelle commented on code in PR #712:
URL: https://github.com/apache/pulsar-site/pull/712#discussion_r1508042620
##########
docs/txn-advanced-features.md:
##########
@@ -37,10 +37,34 @@ If you want to enable authentication with transactions,
follow the steps below.
2. [Configure authentication](security-overview/#authentication) in a Pulsar
client.
+## Select transaction isolation level
+
+To enhance the flexibility of Pulsar transactions, they support two distinct
isolation levels:
+- `READ_COMMITTED`(default): The consumer can only consume all transactional
messages that have been committed.
+- `READ_UNCOMMITTED`: The consumer can consume all messages, even
transactional messages that have been aborted.
+
+For different scenarios, they use different subscriptions and choose different
isolation levels. One needs transaction, one does not. In general, multiple
subscriptions of the same topic do not all
+require transaction guarantees. Some want low latency without the exact-once
semantic guarantee (like a real-time monitoring system), and some must require
the exactly-once guarantee (e.g., business processing systems).
+Users can freely choose different isolation levels according to different
scenarios.
+
+Note that this is a subscription dimension configuration, and all consumers
under the same subscription need to be configured with the same IsolationLevel.
+
+In this example, the consumer builder uses the `READ_UNCOMMITTED` isolation
level.
+
+```java
+Consumer<String> consumer = client
+ .newConsumer(Schema.STRING)
+ .topic("persistent://my-tenant/my-namespace/my-topic")
+ .subscriptionName("my-subscription")
+ .subscriptionType(SubscriptionType.Shared)
+ .subscriptionIsolationLevel(SubscriptionIsolationLevel.READ_COMMITTED) //
Adding the isolation level configuration
Review Comment:
```suggestion
.subscriptionIsolationLevel(SubscriptionIsolationLevel.READ_UNCOMMITTED)
// Adding the isolation level configuration
```
##########
docs/txn-advanced-features.md:
##########
@@ -37,10 +37,34 @@ If you want to enable authentication with transactions,
follow the steps below.
2. [Configure authentication](security-overview/#authentication) in a Pulsar
client.
+## Select transaction isolation level
+
+To enhance the flexibility of Pulsar transactions, they support two distinct
isolation levels:
+- `READ_COMMITTED`(default): The consumer can only consume all transactional
messages that have been committed.
+- `READ_UNCOMMITTED`: The consumer can consume all messages, even
transactional messages that have been aborted.
+
+For different scenarios, they use different subscriptions and choose different
isolation levels. One needs transaction, one does not. In general, multiple
subscriptions of the same topic do not all
+require transaction guarantees. Some want low latency without the exact-once
semantic guarantee (like a real-time monitoring system), and some must require
the exactly-once guarantee (e.g., business processing systems).
Review Comment:
```suggestion
For different scenarios, they use different subscriptions and choose
different isolation levels. One scenario might require transactions, while
another might not. In general, not all subscriptions of the same topic require
transaction guarantees. Some want low latency without the exact-once semantic
guarantee (like a real-time monitoring system), and some must require the
exactly-once guarantee (e.g., business processing systems).
```
--
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]