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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractSubscription.java:
##########
@@ -18,14 +18,37 @@
  */
 package org.apache.pulsar.broker.service;
 
+import org.apache.pulsar.common.api.proto.CommandSubscribe.IsolationLevel;
+
+import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.atomic.LongAdder;
 import java.util.function.ToLongFunction;
 
 public abstract class AbstractSubscription implements Subscription {
+    protected static final String SUBSCRIPTION_ISOLATION_LEVEL_PROPERTY = 
"pulsar.subscription.isolation.level";
     protected final LongAdder bytesOutFromRemovedConsumers = new LongAdder();
     protected final LongAdder msgOutFromRemovedConsumer = new LongAdder();
 
+    public static void wrapIsolationLevelToProperties(Map<String, String> 
properties, IsolationLevel isolationLevel) {
+        if (properties != null) {
+            properties.put(SUBSCRIPTION_ISOLATION_LEVEL_PROPERTY, 
String.valueOf(isolationLevel.getValue()));

Review Comment:
   >It should follow the subscription type. The subscription will use the 
isolation type that the first consumer provided.
   After all consumer disconnected, a new consumer will get a chance to change 
the isolation level.
   
   I agree that the subscription use the isolation type of the first consumer 
provided. But the isolation level should not be changed. Just like schema. 



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