Add consumer priority#3147
Closed
belljun3395 wants to merge 1 commit intospring-cloud:mainfrom
Closed
Conversation
Signed-off-by: belljun3395 <[email protected]>
7e121ab to
5246c35
Compare
olegz
reviewed
Oct 3, 2025
| * Default: -1 (not supported) | ||
| * @since 4.2 | ||
| */ | ||
| private int consumerPriority = -1; |
Contributor
There was a problem hiding this comment.
We don't need this for consistency. It is actually more confusing given the comment. I will remove it
olegz
pushed a commit
that referenced
this pull request
Oct 3, 2025
Signed-off-by: belljun3395 <[email protected]>
olegz
pushed a commit
that referenced
this pull request
Oct 3, 2025
Signed-off-by: belljun3395 <[email protected]>
olegz
added a commit
that referenced
this pull request
Oct 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem Statement
Current Issue
Root Cause: Messaging systems distribute messages in round-robin fashion to individual consumers (not servers), causing load concentration on specific servers during compute-intensive message processing.
Solution
Implemented Consumer Priority mechanism:
Implementation Details
1. RabbitMQ Binder (Full Implementation)
New Properties
Queue Configuration
Consumer Configuration
Usage Example
2. Pulsar Binder (Native Support)
Pulsar already supports
priorityLevelin parent classPulsarProperties.Consumer, automatically mapped intoBaseConsumerPropertiesMap().3. Kafka Binder (API Consistency)
Kafka does not natively support consumer priority. Property added for API consistency with clear documentation of non-support:
Usage Scenario
Before (Problem)
After (With Consumer Priority)
Issue #3122 Resolution
Among the 3 proposed solutions in the issue: