yuruguo opened a new issue #11827:
URL: https://github.com/apache/pulsar/issues/11827
**Is your enhancement request related to a problem? Please describe.**
Option `--subscriber-name` is redundant and easy to cause interference when
the size of `--subscriptions` is equal to 1 but `--num-subscriptions` is not
equal to 1 in command `bin/pulsar-perf consume`, as follow:
_**case 1:**_
`bin/pulsar-perf consume -ns 2 -st Shared -r 100
persistent://public/default/test01`
<table class="table table-bordered" style="width: 75%">
<thead>
<tr>
<th class="text-center" style="width: 15%">Option</th>
<th class="text-center" style="width: 15%">Abbreviation</th>
<th class="text-center" style="width: 15%">Default</th>
<th class="text-center" style="width: 20%">Whether to set</th>
<th class="text-center" style="width: 15%">Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>--num-subscriptions</td>
<td>-ns</td>
<td>1</td>
<td>yes</td>
<td>2</td>
</tr>
<tr>
<td>--subscriptions</td>
<td>-ss</td>
<td>List(sub)</td>
<td>no</td>
<td></td>
</tr>
<tr>
<td>--subscriber-name</td>
<td>-s</td>
<td>sub</td>
<td>no</td>
<td></td>
</tr>
</tbody>
</table>
Although the expected result and the actual result are two subscribers:
sub-0 and sub-1, but in fact option `--subscriber-name` can be completely
**@Deprecated** and replace it with `--subscriptions first element` because the
default value of the two is same.
_**case 2:**_
`bin/pulsar-perf consume -ns 2 -ss mySub -st Shared -r 100
persistent://public/default/test01`
<table class="table table-bordered" style="width: 75%">
<thead>
<tr>
<th class="text-center" style="width: 15%">Option</th>
<th class="text-center" style="width: 15%">Abbreviation</th>
<th class="text-center" style="width: 15%">Default</th>
<th class="text-center" style="width: 20%">Whether to set</th>
<th class="text-center" style="width: 15%">Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>--num-subscriptions</td>
<td>-ns</td>
<td>1</td>
<td>yes</td>
<td>2</td>
</tr>
<tr>
<td>--subscriptions</td>
<td>-ss</td>
<td>List(sub)</td>
<td>yes</td>
<td>List(mySub)</td>
</tr>
<tr>
<td>--subscriber-name</td>
<td>-s</td>
<td>sub</td>
<td>no</td>
<td></td>
</tr>
</tbody>
</table>
Maybe we expect to generate two subscribers: mySub-0 and mySub-1, but
actually sub-0 and sub-1 due to the influence of `--subscriber-name`(default
value is 'sub'), If you use `--subscriptions first element` then could get the
expected results.
_**case 3:**_
`bin/pulsar-perf consume -ns 2 -ss mySub -s sysSub -st Shared -r 100
persistent://public/default/test01`
<table class="table table-bordered" style="width: 75%">
<thead>
<tr>
<th class="text-center" style="width: 15%">Option</th>
<th class="text-center" style="width: 15%">Abbreviation</th>
<th class="text-center" style="width: 15%">Default</th>
<th class="text-center" style="width: 20%">Whether to set</th>
<th class="text-center" style="width: 15%">Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>--num-subscriptions</td>
<td>-ns</td>
<td>1</td>
<td>yes</td>
<td>2</td>
</tr>
<tr>
<td>--subscriptions</td>
<td>-ss</td>
<td>List(sub)</td>
<td>yes</td>
<td>List(mySub)</td>
</tr>
<tr>
<td>--subscriber-name</td>
<td>-s</td>
<td>sub</td>
<td>yes</td>
<td>sysSub</td>
</tr>
</tbody>
</table>
If I set both `--subscriptions` and `--subscriber-name`, who should I use?
Due to historical reasons, `--subscriber-name` appeared before
`--subscriptions`, so only `--subscriber-name` can be used at that time, but
after `--subscriptions` appears, it can also cover case1&case2 while taking it
as the standard.
**Describe the solution you'd like**
deprecate `--subscriber-name` option and substitute `--subscriptions first
element` for it, as follow:
_**class:**_ `org.apache.pulsar.testclient.PerformanceConsumer`
_**code 1:**_

_**code 2:**_

--
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]