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

   ## Summary
   
   Convert the V5 client policy options from records (with public canonical 
constructors) into final classes whose only construction paths are an explicit 
`Builder` and a small set of named factory methods. This keeps the public 
surface to deliberate, documented combinations and lets the classes evolve 
without breaking source compatibility every time a new field is added.
   
   Refactored: `BackoffPolicy`, `BatchingPolicy`, `ChunkingPolicy`, 
`CompressionPolicy`, `ConnectionPolicy`, `DeadLetterPolicy`, 
`EncryptionPolicy`, `ProcessingTimeoutPolicy`, `TlsPolicy`, `TransactionPolicy`.
   
   Each now has:
   - Private constructor.
   - private final fields with record-style accessors (`foo()` — backward 
compatible with existing callers).
   - A static `builder()` plus a fluent inner `Builder` with javadoc on each 
knob.
   - Small, opinionated factories where there's an obvious dominant case (e.g. 
`CompressionPolicy.disabled()`, `TlsPolicy.ofInsecure()`, 
`BatchingPolicy.ofDisabled()`, `BackoffPolicy.fixed`/`exponential(initial, 
max)`, `ProcessingTimeoutPolicy.of(timeout)`, 
`EncryptionPolicy.forProducer`/`forConsumer`).
   - Lombok `@EqualsAndHashCode` + `@ToString` to preserve value-type semantics.
   
   Updated callers — `Examples.java`, `V5DeadLetterPolicyTest`, 
`V5TransactionTest`, `V5ProducerBatchingTest` — to use the builder/factory 
entry points.
   
   ## Test plan
   
   - [x] `pulsar-client-api-v5` and `pulsar-broker` checkstyle clean.
   - [x] V5 affected tests pass: `V5DeadLetterPolicyTest`, `V5TransactionTest`, 
`V5ProducerBatchingTest`, `V5ProcessingTimeoutTest`.


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