[improve][doc] Document producerConfig.batchingConfig for Pulsar Functions - #1215
Merged
david-streamlio merged 2 commits intoAug 25, 2026
Merged
Conversation
…tions PIP-401 added a batchingConfig field to a function's producerConfig, letting a function enable or disable batching and tune the batch size, byte limit, publish delay, and batch builder. None of it is documented: "batchingConfig" appears nowhere in the docs, and the ProducerConfig table lists every sibling field but not this one, so all six of its sub-fields are invisible. Add a BatchingConfig section covering the six fields with their defaults, and a batchingConfig row linking to it from the ProducerConfig table, following the pattern already used for cryptoConfig. Record that only the Java runtime applies these settings today. The Python and Go runtimes hard-code batching to enabled with a 10ms maximum publish delay and ignore the configuration entirely (#26390, #26391), which is the kind of silent mismatch this section exists to surface. Two further notes on rows that were already in the table: - batchingConfig.batchBuilder takes precedence over producerConfig.batchBuilder, so a user who sets both and sees one ignored can now find out why. - The Go client does not implement SNAPPY; instance.go maps it to LZ4 in its default switch arm, so a Go function configured with SNAPPY silently gets LZ4.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Pulsar Functions CLI documentation to cover the previously undocumented producerConfig.batchingConfig settings introduced by PIP-401, including defaults and current runtime support limitations.
Changes:
- Adds a
batchingConfigrow to theProducerConfigtable and links it to a newBatchingConfigsection. - Documents the
BatchingConfigfields, defaults, and notes that only the Java runtime currently applies these settings. - Adds notes clarifying precedence for
batchBuilderand documenting Go’s behavior forSNAPPYcompression.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+160
to
+162
| A function that sets no `producerConfig`, or a `producerConfig` with no `batchingConfig`, gets batching | ||
| enabled with a maximum publish delay of 10 ms. This is the behaviour functions had before these settings | ||
| became configurable, and it is the same across the Java, Python, and Go runtimes. |
…ed docs The contribution guide asks that a documentation change applying to a supported version update versioned_docs alongside docs/. Supported versions today are 5.0.x, 4.2.x, and 4.0.x. PIP-401 added BatchingConfig in 4.1, so the field exists in 4.2.x and 5.0.x but not in 4.0.x, which is left unchanged. The runtime note is identical in both: neither release carries the Python or Go batching support, so batchingConfig is still Java-only there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
PIP-401 added a
batchingConfigfield to a function'sproducerConfig, letting a function enable or disable batching and tune the batch size, byte limit, publish delay, and batch builder.None of it is documented.
batchingConfigappears nowhere in the docs, and theProducerConfigtable infunctions-cli.mdlists every sibling field —maxPendingMessages,cryptoConfig,batchBuilder,compressionType— but not this one. All six sub-fields are invisible to anyone who has not readBatchingConfig.java.Modifications
Add a
BatchingConfigsection covering the six fields with their defaults (enabled=true,batchingMaxPublishDelayMs=10), and abatchingConfigrow linking to it from theProducerConfigtable — the pattern the table already uses forcryptoConfig→ CryptoConfig.Record that only Java applies it today. The Python and Go runtimes hard-code batching to enabled with a 10 ms maximum publish delay and ignore
batchingConfigentirely, tracked as apache/pulsar#26390 and apache/pulsar#26391. Documenting the fields without saying so would just move the surprise rather than remove it: the configuration is accepted, stored, and echoed back byfunctions get, and then ignored.Two further notes on rows that were already in the table, both describing current behaviour:
batchingConfig.batchBuildertakes precedence overproducerConfig.batchBuilder, matching the Java runtime. A user who sets both and sees one ignored has no way to find that out today.SNAPPY.instance.gomaps it toLZ4in the default arm of its compression switch, so a Go function configured withSNAPPYsilently getsLZ4. This one is independent of the rest of the PR and easy to drop if you would rather it went separately.Versioned docs
Supported versions today are 5.0.x, 4.2.x, and 4.0.x. PIP-401 added
BatchingConfigin 4.1, so the field exists in 4.2.x and 5.0.x but not in 4.0.x, which is left unchanged.The runtime note is identical in both versioned copies: neither release carries the Python or Go batching support, so
batchingConfigis still Java-only there.One remainder, deliberately not included: the
SNAPPYnote also holds for 4.0.x, but the rest of this change does not apply to that version, and a lone compression note there seemed better as its own change than as a stray edit here.Follow-up
apache/pulsar#26392 and apache/pulsar#26393 make the Python and Go runtimes honour these settings. When those land, the note in this section needs to become a smaller one —
roundRobinRouterBatchingPartitionSwitchFrequencystays Java-only, andmaxPendingMessagesAcrossPartitionshas no Go equivalent. I will open that as a separate PR rather than describing behaviour that has not shipped.Documentation
This is the documentation change.