You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "merlimat (via GitHub)" <gi...@apache.org> on 2026/06/09 00:01:32 UTC

[PR] [improve][test] pulsar-perf consume: switch between V5 Queue and Stream consumer [pulsar]

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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][test] pulsar-perf consume: switch between V5 Queue and Stream consumer [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #25981:
URL: https://github.com/apache/pulsar/pull/25981


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org