Class ChunkingPolicy
java.lang.Object
org.apache.pulsar.client.api.v5.config.ChunkingPolicy
Configuration for chunking large messages that exceed the broker's max message size.
When chunking is enabled, the producer splits a payload larger than the configured chunk size into smaller pieces that are reassembled by the consumer.
Use ofDisabled() to opt out, or builder() to enable with a
specific chunk size.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ChunkingPolicy.Builderbuilder()intbooleanenabled()static ChunkingPolicyChunking disabled.
-
Method Details
-
enabled
public boolean enabled()- Returns:
- whether chunking is enabled
-
chunkSize
public int chunkSize()- Returns:
- the maximum size of each chunk in bytes (only meaningful when
enabled())
-
ofDisabled
Chunking disabled.- Returns:
- a
ChunkingPolicywith chunking disabled
-
builder
- Returns:
- a new builder for constructing a
ChunkingPolicy
-