Skip to content

Commit

Permalink
Fix IndexOutOfBoundsException when --subscriptions size is less than …
Browse files Browse the repository at this point in the history
…--num-subscriptions in consumption (apache#11797)
  • Loading branch information
yuruguo authored Sep 6, 2021
1 parent d4055b5 commit 652fa23
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,7 @@ public static void main(String[] args) throws Exception {
PerfClientUtils.exit(-1);
}

if (arguments.subscriptionType != SubscriptionType.Exclusive &&
arguments.subscriptions != null &&
arguments.subscriptions.size() != arguments.numConsumers) {
if (arguments.subscriptions != null && arguments.subscriptions.size() != arguments.numSubscriptions) {
// keep compatibility with the previous version
if (arguments.subscriptions.size() == 1) {
List<String> defaultSubscriptions = Lists.newArrayList();
Expand All @@ -234,7 +232,7 @@ public static void main(String[] args) throws Exception {
}
arguments.subscriptions = defaultSubscriptions;
} else {
System.out.println("The size of subscriptions list should be equal to --num-consumers when subscriptionType isn't Exclusive");
System.out.println("The size of subscriptions list should be equal to --num-subscriptions");
jc.usage();
PerfClientUtils.exit(-1);
}
Expand Down

0 comments on commit 652fa23

Please sign in to comment.