yuruguo opened a new pull request #12242:
URL: https://github.com/apache/pulsar/pull/12242


   ### Motivation
   Currently we can use cli `./pulsar-admin topics set-publish-rate` / 
`./pulsar-admin topics set-dispatch-rate` to set message publish/dispatch rate 
for a topic, but its effect is to clear the previous rate and then reset which 
causes the previously rate to disappear (unless I specifically add the previous 
rate when I set it again), for example:
   **1st**
   > ./pulsar-admin topics set-publish-rate `-b 10485760` 
persistent://public/default/topic-rate-test
   ./pulsar-admin topics get-publish-rate 
persistent://public/default/topic-rate-test
   {
      "publishThrottlingRateInMsg" : -1,
      "publishThrottlingRateInByte" : 10485760
    }
   
   **2nd**
   > ./pulsar-admin topics set-publish-rate `-m 1000` 
persistent://public/default/topic-rate-test
   ./pulsar-admin topics get-publish-rate 
persistent://public/default/topic-rate-test
   {
     "publishThrottlingRateInMsg" : 1000,
     "publishThrottlingRateInByte" : -1
   }
   
   The purpose of this PR is to combine the previous and current rate by adding 
an option `--reset-mode`, in this case, we will execute **2nd** as the result 
below.
   **2nd**
   > ./pulsar-admin topics set-publish-rate `-m 1000` --reset-mode false 
persistent://public/default/topic-rate-test
   ./pulsar-admin topics get-publish-rate 
persistent://public/default/topic-rate-test
   {
     "publishThrottlingRateInMsg" : 1000,
     "publishThrottlingRateInByte" : 10485760
   }
   
   ### Documentation  
   - no-need-doc
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to