merlimat opened a new pull request, #25981:
URL: https://github.com/apache/pulsar/pull/25981

   ## Motivation
   
   The `pulsar-perf consume` command always drives the V5 `QueueConsumer`. To 
manually exercise scalable-topic features — in particular auto-split 
([PIP-483](https://github.com/apache/pulsar/blob/master/pip/pip-483.md), where 
a subscription with more consumers than segments should trigger a split — there 
needs to be a way to run it as a `StreamConsumer` instead (ordered, cumulative 
ack, broker-coordinated 1:1 segment-to-consumer assignment).
   
   ## Modifications
   
   - New option `--scalable-consumer-type` / `-sct` on the `consume` command: 
`Queue` (default, unchanged behavior) or `Stream`.
   - A thin `PerfConsumer` adapter unifies `receive` / ack across the two V5 
consumer APIs (`acknowledge` for Queue, `acknowledgeCumulative` for Stream), so 
the poll loop and transaction path are type-agnostic.
   - Consumer creation refactored into a `subscribeAsync()` factory; 
encryption-policy construction extracted into a single helper. This also 
removes a pre-existing dead `QueueConsumerBuilder` that the old code built 
(with an encryption policy) and then never subscribed.
   - `Stream` consumers get a distinct `consumerName` per index so the N 
consumers are distinct members of the group and the controller assigns segments 
1:1.
   
   Usage to drive auto-split:
   ```
   pulsar-perf consume -sct Stream -n 8 topic://tenant/ns/my-scalable-topic
   ```
   
   ## Verifying this change
   
   - `PerformanceConsumerArgsTest` covers the new option (default `Queue`, 
long/short forms, `Stream`).
   - `pulsar-testclient` compiles and checkstyle passes.
   
   ### Does this pull request potentially affect one of the following parts:
   
   - [ ] Dependencies
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] Anything that affects deployment
   
   This only adds a CLI option to the `pulsar-perf` tool; default behavior 
(`Queue`) is unchanged.


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