[benchmark] Add clientRebalanceEnable

Signed-off-by: zhangyang21 <zhangyang21@xiaomi.com>
This commit is contained in:
zhangyang21
2022-02-08 10:38:41 +08:00
committed by RongtongJin
parent a01433094b
commit c998f3fe68
@@ -64,6 +64,7 @@ public class Consumer {
final double failRate = commandLine.hasOption('r') ? Double.parseDouble(commandLine.getOptionValue('r').trim()) : 0.0;
final boolean msgTraceEnable = commandLine.hasOption('m') && Boolean.parseBoolean(commandLine.getOptionValue('m'));
final boolean aclEnable = commandLine.hasOption('a') && Boolean.parseBoolean(commandLine.getOptionValue('a'));
final boolean clientRebalanceEnable = commandLine.hasOption('c') ? Boolean.parseBoolean(commandLine.getOptionValue('c')) : true;
String group = groupPrefix;
if (Boolean.parseBoolean(isSuffixEnable)) {
@@ -132,6 +133,7 @@ public class Consumer {
consumer.setConsumeThreadMin(threadCount);
consumer.setConsumeThreadMax(threadCount);
consumer.setInstanceName(Long.toString(System.currentTimeMillis()));
consumer.setClientRebalance(clientRebalanceEnable);
if (filterType == null || expression == null) {
consumer.subscribe(topic, "*");
@@ -218,6 +220,10 @@ public class Consumer {
opt.setRequired(false);
options.addOption(opt);
opt = new Option("c", "clientRebalanceEnable", true, "Client Rebalance Enable, Default: true");
opt.setRequired(false);
options.addOption(opt);
return options;
}