GitHub user ragaur-tibco edited a discussion: Chunking in Pulsar Producer with
a different message format is exhibiting inconsistent behavior
```
I observed the following differences in behavior when testing the Chunking
feature with respect to the message format.
In the String Message format, 210 bytes of payload were sent and the
ChunkMaxMessageSize was set to 10. There were 21 chunks created (210/10), which
is in accordance with expectations.
The payload size for Binary Message format was 342 bytes, and the chunk size
was set to 30 bytes. This resulted in 14 chunks being created, instead of
342/30, which would have resulted in 11 or 12 chunks being created.
We sent a JSON message with a payload of 623 bytes and a chunk maximum of 20
bytes. The total number of chunks created was 21, which should be around 623/20
or 31 or 32 total chunks, which was not the case.
For the Avro message format, we sent 225 bytes of payload and set the
ChunkMaxMessageSize to 19. There were a total of three chunks created, which
was not as expected since 225 divided by 19 equals 11 or 12 chunks in total.
```
```
Producer producerObj = client.newProducer()
.topic(topicName)
.accessMode(accessMode)
.compressionType(compressionType)
.sendTimeout(10, TimeUnit.SECONDS)
.enableBatching(false)
.enableChunking(true)
.chunkMaxMessageSize(chunkMaxMsgSize)
.create();
```
GitHub link: https://github.com/apache/pulsar/discussions/22460
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]