-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
enhancementNew feature or requestNew feature or requestgoPull requests that update go codePull requests that update go code
Description
Background
The current SendMessageBatch()
in go-shuttle fails if the message array exceeds the max batch size. There is a new use case to send a large number of messages (up to 5000), which may require splitting into multiple batches.
Problem
The existing method does not support sending messages across multiple batches, and hiding this logic inside the current function could be unclear for consumers.
Proposal
- Add a new method: Add
SendAsBatch(ctx, messages, options)
to Sender, with an option likeallowMultipleBatch
(default: false) to control batching behavior. Reference: SDK example. - Deprecate current method: Make
SendMessageBatch()
call the new method withallowMultipleBatch
as false, and markSendMessageBatch
as deprecated. - Unit tests: Ensure all existing unit tests for
SendMessageBatch
pass and add comprehensive unit tests for the newSendAsBatch()
method. Aim for 100% unit test coverage.
Labels: enhancement, go
Additional context
- This change should make it easier for consumers to send large numbers of messages efficiently, without having to handle the batching logic themselves.
- Please ensure clear documentation and deprecation notices for the affected methods.
Copilot
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgoPull requests that update go codePull requests that update go code