From d05754e69dac06b049d863efca5fe9c3abb08d47 Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Wed, 27 Jul 2022 10:30:17 +0800 Subject: [PATCH] [fix][broker] Run sendMessagesToConsumers in the same thread by default ### Motivation See https://github.com/apache/pulsar/issues/16802 and the discussion in https://github.com/apache/pulsar/pull/16803. Before reverting #16603, disabling the `dispatcherDispatchMessagesInSubscriptionThread` option first. ### Modifications Change the default value of `dispatcherDispatchMessagesInSubscriptionThread` to false. --- conf/broker.conf | 4 ++-- .../java/org/apache/pulsar/broker/ServiceConfiguration.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/broker.conf b/conf/broker.conf index 7f07ae5444993..daeb9193fac8e 100644 --- a/conf/broker.conf +++ b/conf/broker.conf @@ -407,7 +407,7 @@ dispatchThrottlingOnNonBacklogConsumerEnabled=true dispatcherMaxReadBatchSize=100 # Dispatch messages and execute broker side filters in a per-subscription thread -dispatcherDispatchMessagesInSubscriptionThread=true +dispatcherDispatchMessagesInSubscriptionThread=false # Max size in bytes of entries to read from bookkeeper. By default it is 5MB. dispatcherMaxReadSizeBytes=5242880 @@ -1572,4 +1572,4 @@ managedLedgerMaxUnackedRangesToPersistInZooKeeper=-1 # If enabled, the maximum "acknowledgment holes" will not be limited and "acknowledgment holes" are stored in # multiple entries. -persistentUnackedRangesWithMultipleEntriesEnabled=false \ No newline at end of file +persistentUnackedRangesWithMultipleEntriesEnabled=false diff --git a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java index 2dfa122d83dcf..92bc633a38473 100644 --- a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java +++ b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java @@ -995,7 +995,7 @@ public class ServiceConfiguration implements PulsarConfiguration { category = CATEGORY_SERVER, doc = "Dispatch messages and execute broker side filters in a per-subscription thread" ) - private boolean dispatcherDispatchMessagesInSubscriptionThread = true; + private boolean dispatcherDispatchMessagesInSubscriptionThread = false; // <-- dispatcher read settings --> @FieldContext(