liangyepianzhou commented on a change in pull request #11333:
URL: https://github.com/apache/pulsar/pull/11333#discussion_r671028181



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -343,7 +351,16 @@ public PersistentTopic(String topic, ManagedLedger ledger, 
BrokerService brokerS
         this.backloggedCursorThresholdEntries =
                 
brokerService.pulsar().getConfiguration().getManagedLedgerCursorBackloggedThreshold();
         this.transactionCompletableFuture = new CompletableFuture<>();
-        if 
(brokerService.pulsar().getConfiguration().isTransactionCoordinatorEnabled()) {
+        TopicName topicName = TopicName.get(topic);
+        Optional<Policies> policies = null;
+        try {
+            policies = 
brokerService.pulsar().getConfigurationCache().policiesCache()
+                    .get(AdminResource.path(POLICIES, 
topicName.getNamespaceObject().toString()));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if 
(brokerService.pulsar().getConfiguration().isTransactionCoordinatorEnabled()
+                && policies.get().transaction_enable) {
             this.transactionBuffer = brokerService.getPulsar()

Review comment:
       In my humble opinion, transactionBuffer should look like topic level.




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