You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2020/12/23 03:21:38 UTC
[pulsar] 01/04: add if for SubscriptionBusyException (#9017)
This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit df884b82ca597de45d602f51d5e9d52ecc9ee461
Author: cimura <35...@users.noreply.github.com>
AuthorDate: Wed Dec 23 02:50:53 2020 +0900
add if for SubscriptionBusyException (#9017)
### Motivation
when `SubscriptionBusyException` is thrown in a broker, `getClientErrorCode` doesn't deal with it and the returned code is incorrect.
### Modifications
add `else if` for `SubscriptionBusyException` in `getClientErrorCode`
### Verifying this change
- [x] Make sure that the change passes the CI checks.
This change is a trivial rework / code cleanup without any test coverage.
(cherry picked from commit 973c14e1bd429946fc9008eabedab9e734fb07c6)
---
.../java/org/apache/pulsar/broker/service/BrokerServiceException.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerServiceException.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerServiceException.java
index 9c6b2d1..c0c0b1f 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerServiceException.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerServiceException.java
@@ -191,6 +191,8 @@ public class BrokerServiceException extends Exception {
return PulsarApi.ServerError.PersistenceError;
} else if (t instanceof ConsumerBusyException) {
return PulsarApi.ServerError.ConsumerBusy;
+ } else if (t instanceof SubscriptionBusyException) {
+ return PulsarApi.ServerError.ConsumerBusy;
} else if (t instanceof ProducerBusyException) {
return PulsarApi.ServerError.ProducerBusy;
} else if (t instanceof UnsupportedVersionException) {