Merged
Conversation
Closes: #77 Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds pre-settled delivery mode support to consumers, enabling "fire-and-forget" or "at-most-once" semantics where messages are automatically settled by the broker without requiring explicit acknowledgment from the consumer. This is implemented through a new PreSettled option in ConsumerOptions.
Changes:
- Introduced
IDeliveryContextinterface andPreSettledDeliveryContexttype that returns errors when settlement methods are called - Updated AMQP receiver link options to support pre-settled mode with appropriate settlement mode configuration
- Modified test files to use the public
Message()accessor method instead of direct field access - Added comprehensive test coverage and example demonstrating the pre-settled feature
- Updated CI Docker image from RC to stable RabbitMQ 4.2
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/rabbitmqamqp/amqp_types.go | Added preSettled() method to IConsumerOptions interface and implemented it across all consumer option types |
| pkg/rabbitmqamqp/amqp_utils.go | Modified receiver link creation to configure appropriate settlement modes based on pre-settled option |
| pkg/rabbitmqamqp/amqp_consumer.go | Added IDeliveryContext interface, PreSettledDeliveryContext type, and logic to return appropriate delivery context based on consumer options |
| pkg/rabbitmqamqp/responder.go | Updated to use Message() method instead of direct field access for better encapsulation |
| pkg/rabbitmqamqp/amqp_consumer_test.go | Added comprehensive test for pre-settled mode verifying message consumption and error handling |
| pkg/rabbitmqamqp/amqp_consumer_stream_test.go | Updated test assertions to use Message() accessor method |
| docs/examples/pre_settled/pre_settled.go | Added complete example demonstrating pre-settled message consumption |
| docs/examples/README.md | Added documentation entry for pre-settled example |
| .ci/ubuntu/gha-setup.sh | Updated Docker image from 4.2-rc to stable 4.2 release |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.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.
This PR adds pre-settled delivery mode support to consumers, enabling "fire-and-forget" or "at-most-once" semantics where messages are automatically settled by the broker without requiring explicit acknowledgment from the consumer. This is implemented through a new
PreSettledoption inConsumerOptions.Changes:
IDeliveryContextinterface andPreSettledDeliveryContexttype that returns errors when settlement methods are calledMessage()accessor method instead of direct field accessCloses: #77