pulsar: make max-message-bytes configurable
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 56
- Forks
- 63
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 34
Description
Is your feature request related to a problem?
The Pulsar sink hardcodes the maximum message size to 10MB (DefaultMaxMessageBytes) in downstreamadapter/sink/pulsar/helper.go. Users whose Pulsar brokers are configured with a different maxMessageSize have no way to align TiCDC's encoder limit with their broker configuration, which can cause silent message truncation or send failures.
Describe the feature you'd like
Add a max-message-bytes URI parameter to the Pulsar sink, matching the existing Kafka sink behavior:
pulsar://host:6650/topic?protocol=canal-json&max-message-bytes=5242880
Implementation:
- Add
MaxMessageBytes *intfield toPulsarConfiginpkg/config/sink.go. - Parse the parameter from the sink URI in
pkg/sink/pulsar/config.go, defaulting to 10MB when omitted. - Pass the configured value to
GetEncoderConfigindownstreamadapter/sink/pulsar/helper.go.
Describe alternatives you've considered
Users currently have no workaround other than patching the source code or ensuring all messages stay under 10MB. The Kafka sink already supports this parameter, so the pattern is well established in the codebase.
Teachability, Documentation, Adoption, Migration Strategy
The Pulsar sink URI parameter documentation should list max-message-bytes with its default value (10485760, i.e. 10MB). No migration is needed for existing changefeeds since the default is unchanged.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the existing Kafka sink handling for max-message-bytes, then inspect pkg/config/sink.go, pkg/sink/pulsar/config.go, and downstreamadapter/sink/pulsar/helper.go. The work is complete when the Pulsar URI accepts the parameter, defaults to 10485760, passes it to the encoder configuration, and the sink documentation lists it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, stream-processing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100