merlimat opened a new pull request, #25588: URL: https://github.com/apache/pulsar/pull/25588
## Summary Round-out V5 client end-to-end coverage for producer / consumer builder knobs, plus the V5 client fixes those tests surfaced. Builds on PIP-468 (#25573, #25586) and is independent of #25587. **V5 client fixes:** - Propagate the user-facing `ConsumerConfigurationData` to per-segment v4 consumers (was building a fresh config that dropped DLQ / negative-ack backoff / ackTimeout / subscriptionInitialPosition / etc.). - Propagate the user-facing `ProducerConfigurationData` to per-segment v4 producers (same problem on the producer side — compression / batching / chunking / encryption / initialSequenceId / accessMode / properties were silently dropped). - Map `ProducerAccessMode` enum from V5's SCREAMING_SNAKE_CASE to v4's PascalCase (the previous `valueOf(name())` threw `IllegalArgumentException` for every value). - For exclusive access modes (EXCLUSIVE / EXCLUSIVE_WITH_FENCING / WAIT_FOR_EXCLUSIVE), eagerly claim every active segment at `create()` time. Per-segment producers were lazy, so a second EXCLUSIVE producer could `create()` before the broker noticed the collision; `WAIT_FOR_EXCLUSIVE` did not actually block at `create()`. - `lastSequenceId()` now reflects the configured `initialSequenceId` even before any segment producer exists. - `getOrCreateSegmentProducer` no longer wraps v4 `PulsarClientException` in a bare `RuntimeException`. - Refresh `V5ClientBaseTest` with a shared per-class `v5Client` field (mirrors the v4 `pulsarClient` field) to keep tests focused. **New e2e tests (all under `pulsar-broker/src/test/java/org/apache/pulsar/client/api/v5/`):** - `V5SchemaRoundtripTest` — bytes / string / bool / int8/16/32/64 / float32/64 / json / avro / protobuf / autoProduceBytes - `V5MessageMetadataTest` — eventTime, properties (single + batch), deliverAfter, deliverAt - `V5ProducerCompressionTest` — all `CompressionType` values + disabled + default - `V5ProducerBatchingTest` — default, disabled, tight delay, small batch size - `V5ProducerSequenceIdTest` — `lastSequenceId`, `initialSequenceId`, explicit sequenceId, dedup - `V5ProducerAccessModeTest` — SHARED multi-producer, EXCLUSIVE rejects second create(), WAIT_FOR_EXCLUSIVE blocks then succeeds after release - `V5SubscriptionInitialPositionTest` — EARLIEST / LATEST for QueueConsumer + StreamConsumer - `V5AckTimeoutTest` — unacked redelivery after `ackTimeout` - `V5DeadLetterPolicyTest` — message lands on DLQ after `maxRedeliverCount`. Documents a known V5 gap: the source consumer's underlying v4 `ConsumerImpl` creates the DLQ producer via `client.newProducer(...)`, which rejects `topic://` scalable URIs, so the DLQ topic is currently a regular persistent topic. ### Motivation PR #25586 covered a smoke test. The basics are tracked in #25587. This PR adds the missing knob-level coverage and lands the V5 fixes the tests surfaced — keeping #25587 untouched. ## Test plan - [x] `./gradlew :pulsar-broker:test --tests "org.apache.pulsar.client.api.v5.V5SchemaRoundtripTest"` - [x] `./gradlew :pulsar-broker:test --tests "org.apache.pulsar.client.api.v5.V5MessageMetadataTest"` - [x] `./gradlew :pulsar-broker:test --tests "org.apache.pulsar.client.api.v5.V5ProducerCompressionTest"` - [x] `./gradlew :pulsar-broker:test --tests "org.apache.pulsar.client.api.v5.V5ProducerBatchingTest"` - [x] `./gradlew :pulsar-broker:test --tests "org.apache.pulsar.client.api.v5.V5ProducerSequenceIdTest"` - [x] `./gradlew :pulsar-broker:test --tests "org.apache.pulsar.client.api.v5.V5ProducerAccessModeTest"` - [x] `./gradlew :pulsar-broker:test --tests "org.apache.pulsar.client.api.v5.V5SubscriptionInitialPositionTest"` - [x] `./gradlew :pulsar-broker:test --tests "org.apache.pulsar.client.api.v5.V5AckTimeoutTest"` - [x] `./gradlew :pulsar-broker:test --tests "org.apache.pulsar.client.api.v5.V5DeadLetterPolicyTest"` ## Matching PR - [ ] No matching PR. ### area/test -- 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]
