Skip to content

Add pre-settled option to consumer#80

Merged
Gsantomaggio merged 3 commits intomainfrom
feat/consumer_pre_settled
Jan 22, 2026
Merged

Add pre-settled option to consumer#80
Gsantomaggio merged 3 commits intomainfrom
feat/consumer_pre_settled

Conversation

@Gsantomaggio
Copy link
Copy Markdown
Member

@Gsantomaggio Gsantomaggio commented Jan 22, 2026

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 IDeliveryContext interface and PreSettledDeliveryContext type 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

Closes: #77

Closes: #77

Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
@Gsantomaggio Gsantomaggio self-assigned this Jan 22, 2026
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 IDeliveryContext interface and PreSettledDeliveryContext type 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.

Comment thread docs/examples/pre_settled/pre_settled.go Outdated
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
@Gsantomaggio Gsantomaggio added this to the 0.6.0 milestone Jan 22, 2026
@Gsantomaggio Gsantomaggio added the enhancement New feature or request label Jan 22, 2026
@Gsantomaggio Gsantomaggio merged commit 3ae90e9 into main Jan 22, 2026
@Gsantomaggio Gsantomaggio deleted the feat/consumer_pre_settled branch January 22, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pre-settled option to consumer

2 participants