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


##########
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:
   There are differences between Kafka and Pulsar in filtering the aborted 
message. 
   
   Kafka filters the aborted message on the client side, so if the client uses 
`READ_UNCOMMITED`, the client can't feel the ongoing transaction, the client is 
only able to filter the markers. If we need to filter the abort message on the 
kafka client, it requires to response of the `abortedTransactions` data each 
fetch, which will reduce the consumption performance.
   
   Pulsar has different implements for filter parts, the filter logic is on the 
Broker side. If it is to reduce read and write latency, it is okay.
   
   But I think reading all messages just like Kafka is beneficial in the 
following cases:
   In the event of issues or during development and testing phases, having 
access to all messages, including uncommitted ones, can be valuable for 
debugging and troubleshooting.



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