Skip to content

[Enhancement] Share consumption threads for Proxy internal clients #11089

Description

@qianye1001

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions