feat(queue): add vendor-agnostic messaging queue interfaces#18
Merged
Conversation
This was referenced Feb 17, 2026
sbalabanov
reviewed
Feb 17, 2026
2fe0918 to
5c2e4c5
Compare
sbalabanov
requested changes
Feb 17, 2026
behinddwalls
added a commit
that referenced
this pull request
Feb 17, 2026
Address PR #18 architectural feedback to follow Go idioms by making Delivery an interface that provides both data access and operations. **extensions/queue/delivery.go** - Delivery interface - Message() returns Message by value (not pointer) - Ack(ctx) error - acknowledge successful processing - Nack(ctx, requeueAfter) error - reject and requeue - ExtendVisibilityTimeout(ctx, duration) error - extend processing time - Helper methods: DeliveryID(), Attempt(), ReceivedAt(), Metadata() **extensions/queue/subscriber.go** - Updated interface - Subscribe returns (<-chan Delivery, error) - Each Delivery has its own ack/nack methods **entities/queue/** - Message entity only - Removed Delivery from entities (now an interface in extensions) - Message remains as pure value type entity - Message.Copy() uses maps.Clone() with nil check Key design: - Delivery is an interface (implementations hold backend-specific state) - Message is a value type (pure data, follows Go idioms) - Cleaner API: delivery.Ack(ctx) instead of handler.Ack(ctx, deliveryID) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5c2e4c5 to
f06ea48
Compare
sbalabanov
requested changes
Feb 18, 2026
Address PR #18 architectural feedback to follow Go idioms by making Delivery an interface that provides both data access and operations. **extensions/queue/delivery.go** - Delivery interface - Message() returns Message by value (not pointer) - Ack(ctx) error - acknowledge successful processing - Nack(ctx, requeueAfter) error - reject and requeue - ExtendVisibilityTimeout(ctx, duration) error - extend processing time - Helper methods: DeliveryID(), Attempt(), ReceivedAt(), Metadata() **extensions/queue/subscriber.go** - Updated interface - Subscribe returns (<-chan Delivery, error) - Each Delivery has its own ack/nack methods **entities/queue/** - Message entity only - Removed Delivery from entities (now an interface in extensions) - Message remains as pure value type entity - Message.Copy() uses maps.Clone() with nil check Key design: - Delivery is an interface (implementations hold backend-specific state) - Message is a value type (pure data, follows Go idioms) - Cleaner API: delivery.Ack(ctx) instead of handler.Ack(ctx, deliveryID) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f06ea48 to
068672d
Compare
sbalabanov
approved these changes
Feb 19, 2026
| // Implementations should handle infrastructure errors internally (e.g., reconnect). | ||
| // | ||
| // Each Delivery provides the message and methods to acknowledge or reject it. | ||
| // Consumers should call delivery.Ack() or delivery.Nack() for each delivery. |
Contributor
There was a problem hiding this comment.
nit: also define when the implementation can return an error.
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.
Summary
Why?
To enable vendor-agnostic queue integration across multiple backends (Kafka, SQS, RabbitMQ) without coupling to specific implementations.
What?
Adds queue extension interfaces and message entity:
extensions/queue/
entities/queue/
Test Plan
Stack