Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a bulk send feature with pipelining for RabbitMQ to increase throughput when sending messages without waiting for individual acknowledgments. Key changes include:
- Introduction of BulkSend and BulkSendTo API methods in the exchange implementation.
- Updates to tests and mocks to support the new bulk sending functionality.
- Minor dependency version bumps and code refactorings to support the changes.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/util_test.go | Adds helper types and functions to support testing scenarios. |
| test/rabbit_events_test.go | Updates test cases to verify cancellation and bulk send behavior. |
| test/auto_generated_rabbitGenMock.go | Adds mocks for the new BulkSend and BulkSendTo methods. |
| rabbit.go | Introduces the BulkSendMessageHandleFunc type. |
| go.mod | Updates dependency versions. |
| exchange.go | Implements the new bulk send methods and updates exchange declaration. |
Comments suppressed due to low confidence (1)
exchange.go:441
- [nitpick] Modifying the input messages slice in-place to mark successfully sent messages could lead to side effects if the same slice is reused elsewhere. Consider using a new slice for unsent messages to enhance code clarity and maintainability.
if ack { messages[i] = nil }
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Ticket:
https://kalido.monday.com/boards/1192473331/pulses/1873297221
We need to increase throughput when sending events to RabbitMQ in bulk. The official recommendation is to use pipelining, by sending multiple messages to RabbitMQ without waiting for each one to complete before sending the next (and only then checking whether each was successful).