Repository navigation
Conversation
liangyuanpeng
left a comment
Contributor
There was a problem hiding this comment.
Thanks for your work and added some comment.
| options.PriorityLevel = 0 | ||
| } | ||
|
|
||
| if options.Type != Shared { |
Author
There was a problem hiding this comment.
Is PriorityLevel effectived when SubscriptionType is Shared?
merlimat
reviewed
Jun 23, 2022
merlimat
left a comment
Contributor
There was a problem hiding this comment.
We should have a unit test to check the priorities are applied correctly
Author
ok, I will add unit test later. |
grishaf
added a commit
to grishaf/pulsar-client-go
that referenced
this pull request
Apr 27, 2026
Add PriorityLevel field to ConsumerOptions to allow setting the priority level for consumers on Shared and Failover subscriptions, matching the Java client's ConsumerBuilder.priorityLevel(int) API. In Shared subscription mode, the broker dispatches messages to the highest priority consumers first (0 = max priority). In Failover subscription mode for partitioned topics, the broker selects the active consumer based on priority level and lexicographic consumer name sorting. Previously the Go client hardcoded PriorityLevel to nil in the CommandSubscribe protobuf message. This change threads the user- provided priority level through ConsumerOptions -> partitionConsumerOpts -> CommandSubscribe. Negative priority levels are rejected with InvalidConfiguration error, matching the Java client's IllegalArgumentException behavior. Master Issue: apache/pulsar#134 Supersedes: apache#783 (closed without merge, lacked tests and had validation bugs) Made-with: Cursor
grishaf
added a commit
to grishaf/pulsar-client-go
that referenced
this pull request
Apr 27, 2026
Add PriorityLevel field to ConsumerOptions to allow setting the
priority level for consumers on Shared and Failover subscriptions,
matching the Java client's ConsumerBuilder.priorityLevel(int) API.
In Shared subscription mode, the broker dispatches messages to the
highest priority consumers first (0 = max priority). In Failover
subscription mode for partitioned topics, the broker selects the
active consumer based on priority level and lexicographic consumer
name sorting.
Previously the Go client hardcoded PriorityLevel to nil in the
CommandSubscribe protobuf message. This change threads the user-
provided priority level through ConsumerOptions -> partitionConsumerOpts
-> CommandSubscribe.
Negative priority levels are rejected with InvalidConfiguration error,
matching the Java client's IllegalArgumentException behavior.
Master Issue: apache/pulsar#134
Supersedes: apache#783 (closed without merge, lacked tests and had validation bugs)
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.
<--
Contribution Checklist
Name the pull request in the form "[Issue XYZ][component] Title of the pull request", where XYZ should be replaced by the actual issue number.
Skip Issue XYZ if there is no associated github issue for this pull request.
Skip component if you are unsure about which is the best component. E.g.
[docs] Fix typo in produce method.Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
Each pull request should address only one issue, not mix up code from multiple issues.
Each commit in the pull request has a meaningful commit message
Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
(The sections below can be removed for hotfixes of typos)
-->
(If this PR fixes a github issue, please add
Fixes #<xyz>.)Fixes #
(or if this PR is one task of a github issue, please add
Master Issue: #<xyz>to link to the master issue.)Master Issue: #134
Motivation
support priority level for subscription of shared subscription type
Explain here the context, and why you're making that change. What is the problem you're trying to solve.
Modifications
Describe the modifications you've done.
consumer options support priority level for subscription of shared subscription type
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation