-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add maxUnackedMessagesPerSubscription and maxUnackedMessagesPerConsumer on namespaces policies #5936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add maxUnackedMessagesPerSubscription and maxUnackedMessagesPerConsumer on namespaces policies #5936
Conversation
…er on namespaces policies Signed-off-by: xiaolong.ran <[email protected]>
Signed-off-by: xiaolong.ran <[email protected]>
Signed-off-by: xiaolong.ran <[email protected]>
@sijie @jiazhai @codelipenghui PTAL thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to handle policies update events(https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L1291). Otherwise we need unload namespace or restart broker to let the new settings take effect.
Signed-off-by: xiaolong.ran <[email protected]>
Signed-off-by: xiaolong.ran <[email protected]>
@codelipenghui PTAL thanks. |
ping @codelipenghui PTAL again, thanks. |
run java8 tests |
@codelipenghui can you review this pull request? |
@sijie I took a look, maybe not solve my previous comment. I think @wolfstudy can add a unit test to ensure the dispatcher can handle the policy update. because your current unit test works on zookeeper (write policy data to zookeeper and get policy data from zookeeper), this does not ensure that the dispatcher can work well with policy update. |
@wolfstudy can you please take a look at @codelipenghui 's comments? |
Of course, will fix it |
Signed-off-by: xiaolong.ran <[email protected]>
Signed-off-by: xiaolong.ran <[email protected]>
Signed-off-by: xiaolong.ran <[email protected]>
Signed-off-by: xiaolong.ran <[email protected]>
@@ -454,6 +454,14 @@ protected void mergeNamespaceWithDefaults(Policies policies, String namespace, S | |||
policies.max_consumers_per_subscription = config.getMaxConsumersPerSubscription(); | |||
} | |||
|
|||
if (policies.max_unacked_messages_per_consumer < 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (policies.max_unacked_messages_per_consumer < 1) { | |
if (policies.max_unacked_messages_per_consumer == -1) { |
policies.max_unacked_messages_per_consumer = config.getMaxUnackedMessagesPerConsumer(); | ||
} | ||
|
||
if (policies.max_unacked_messages_per_subscription < 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (policies.max_unacked_messages_per_subscription < 1) { | |
if (policies.max_unacked_messages_per_subscription == -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a minor comment about merge polices method when get polices
@sijie I suggest @wolfstudy to change the default value of |
Signed-off-by: xiaolong.ran <[email protected]>
ping @sijie PTAL thanks |
Signed-off-by: xiaolong.ran <[email protected]>
Signed-off-by: xiaolong.ran <[email protected]>
run java8 tests |
1 similar comment
run java8 tests |
Signed-off-by: xiaolong.ran <[email protected]>
@sijie the docs fixed done, PTAL |
run integration tests |
retest this please |
run java8 tests |
run java8 tests |
1 similar comment
run java8 tests |
run java8 tests |
Signed-off-by: xiaolong.ran <[email protected]>
Signed-off-by: xiaolong.ran <[email protected]>
Signed-off-by: xiaolong.ran <[email protected]>
Signed-off-by: xiaolong.ran <[email protected]>
…er on namespaces policies (apache#5936) * Add maxUnackedMessagesPerSubscription and maxUnackedMessagesPerConsumer on namespaces policies Signed-off-by: xiaolong.ran <[email protected]> * update admin cli docs Signed-off-by: xiaolong.ran <[email protected]> * add test case Signed-off-by: xiaolong.ran <[email protected]> * fix comments Signed-off-by: xiaolong.ran <[email protected]> * add test case for max unacked messages Signed-off-by: xiaolong.ran <[email protected]> * fix comments Signed-off-by: xiaolong.ran <[email protected]> * fix no space issue Signed-off-by: xiaolong.ran <[email protected]>
Signed-off-by: xiaolong.ran [email protected]
Master Issue: #2939
Modifications
get-max-unacked-messages-per-subscription
on namespaces policiesset-max-unacked-messages-per-subscription
on namespaces policiesget-max-unacked-messages-per-consumer
on namespaces policiesset-max-unacked-messages-per-consumer
on namespaces policies