poorbarcode commented on code in PR #21246:
URL: https://github.com/apache/pulsar/pull/21246#discussion_r1374222401


##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java:
##########
@@ -831,6 +831,16 @@ public interface ConsumerBuilder<T> extends Cloneable {
      */
     ConsumerBuilder<T> autoScaledReceiverQueueSizeEnabled(boolean enabled);
 
+    /**
+     * Sets the {@link SubscriptionIsolationLevel} for the consumer.
+     *
+     * @param subscriptionIsolationLevel If READ_COMMITTED is selected, the 
Consumer can only consume all transactional messages which have been committed,
+     *                                   else if READ_UNCOMMITTED is selected, 
the Consumer can consume all messages, even transactional messages which have 
been aborted.
+     *                                   Note that this is a subscription 
dimension configuration, and all consumers under the same subscription need to 
be configured with the same IsolationLevel.

Review Comment:
   @codelipenghui @hzh0425 
   
   In the current PR, the implementation is different with Kafka:
   -  Kafka: the consumer will receive all messages, even if the messages have 
been aborted.
   - Current PR:
     - the consumer will receive committed messages;
     - the consumer will receive the messages that state `transaction 
on-gonging`, once the transaction was aborted, these messages could not be 
received.



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java:
##########
@@ -831,6 +831,16 @@ public interface ConsumerBuilder<T> extends Cloneable {
      */
     ConsumerBuilder<T> autoScaledReceiverQueueSizeEnabled(boolean enabled);
 
+    /**
+     * Sets the {@link SubscriptionIsolationLevel} for the consumer.
+     *
+     * @param subscriptionIsolationLevel If READ_COMMITTED is selected, the 
Consumer can only consume all transactional messages which have been committed,
+     *                                   else if READ_UNCOMMITTED is selected, 
the Consumer can consume all messages, even transactional messages which have 
been aborted.
+     *                                   Note that this is a subscription 
dimension configuration, and all consumers under the same subscription need to 
be configured with the same IsolationLevel.

Review Comment:
   @codelipenghui @hzh0425 @liangyepianzhou 
   
   In the current PR, the implementation is different with Kafka:
   -  Kafka: the consumer will receive all messages, even if the messages have 
been aborted.
   - Current PR:
     - the consumer will receive committed messages;
     - the consumer will receive the messages that state `transaction 
on-gonging`, once the transaction was aborted, these messages could not be 
received.



-- 
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]

Reply via email to