Motivation
Reduce the number of consumption threads used by Proxy internal clients by allowing them to share a consumption executor. System-message syncers currently create PushConsumers with dedicated consumption pools, and callers cannot supply a shared executor.
Proposed change
- Allow
DefaultMQPushConsumer to accept an externally owned ExecutorService, including a virtual-thread executor supplied by applications running on JDK 21 or later.
- Wire a Proxy-owned executor through the internal system-message consumers. Keep consumer groups, subscriptions and offsets unchanged.
- Initialize the Proxy executor from
ProxyConfig: core size = available processors, maximum size = twice available processors, queue capacity = 10000, and discard-oldest rejection policy.
- Use the injected executor directly and leave its shutdown to the caller. Keep ordinary consumers' existing behavior unchanged; discard handling belongs to the Proxy policy.
- Document that silently discarding consumption tasks can retain cached messages and pin offsets. Proxy should use the existing broadcast failure-result processing, which does not retry failed consumption.
Motivation
Reduce the number of consumption threads used by Proxy internal clients by allowing them to share a consumption executor. System-message syncers currently create PushConsumers with dedicated consumption pools, and callers cannot supply a shared executor.
Proposed change
DefaultMQPushConsumerto accept an externally ownedExecutorService, including a virtual-thread executor supplied by applications running on JDK 21 or later.ProxyConfig: core size = available processors, maximum size = twice available processors, queue capacity = 10000, and discard-oldest rejection policy.