michaeljmarshall commented on a change in pull request #13839:
URL: https://github.com/apache/pulsar/pull/13839#discussion_r789130936
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -318,6 +323,18 @@ public PulsarService(ServiceConfiguration config,
this.ioEventLoopGroup =
EventLoopUtil.newEventLoopGroup(config.getNumIOThreads(),
config.isEnableBusyWait(),
new DefaultThreadFactory("pulsar-io"));
+ // the internal executor is not used in the broker client or
replication clients since this executor is
+ // used for consumers and the transaction support in the client.
+ // since an instance is required, a single threaded shared instance is
used for all broker client instances
+ this.brokerClientSharedInternalExecutorProvider =
+ new ExecutorProvider(1,
"broker-client-shared-internal-executor");
+ // the external executor is not used in the broker client or
replication clients since this executor is
+ // used for consumer listeners.
+ // since an instance is required, a single threaded shared instance is
used for all broker client instances
Review comment:
Doesn't this hint at a problem in the java client? It looks like a
listener is declared on consumer initialization. We could change the behavior
so that it only gets a thread when there is a listener.
We'll still have the issue of creating an `ExecutorProvider` per client, so
this change still makes sense, but it'd be cheaper for end users to avoid the
thread creation for consumers that lack listeners.
I am going to open a PR to update the Java Consumer.
--
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]