Skip to content

feat(queue/sql): add data access layer stores#21

Merged
behinddwalls merged 1 commit into
mainfrom
sql-queue-stores
Feb 20, 2026
Merged

feat(queue/sql): add data access layer stores#21
behinddwalls merged 1 commit into
mainfrom
sql-queue-stores

Conversation

@behinddwalls
Copy link
Copy Markdown
Collaborator

@behinddwalls behinddwalls commented Feb 17, 2026

Summary

Why?

Need data access layer to abstract database operations for message storage, offset tracking, and partition leasing in the SQL queue implementation.

What?

  • MessageStore: insert, fetch, delete, DLQ, and visibility timeout operations
  • OffsetStore: consumer offset tracking with atomic ack
  • PartitionLeaseStore: distributed partition leasing with automatic discovery

Test Plan

Issues

@behinddwalls behinddwalls requested review from a team and sbalabanov as code owners February 17, 2026 04:59
@behinddwalls behinddwalls force-pushed the sql-queue-schema-config branch from 3477145 to f312df5 Compare February 17, 2026 07:28
@behinddwalls behinddwalls force-pushed the sql-queue-schema-config branch from f312df5 to 38c7cf2 Compare February 17, 2026 07:55
@behinddwalls behinddwalls force-pushed the sql-queue-stores branch 2 times, most recently from d64e7ab to 7e18f89 Compare February 17, 2026 22:19
@behinddwalls behinddwalls force-pushed the sql-queue-schema-config branch 2 times, most recently from 73e753a to 825992e Compare February 18, 2026 00:34
@behinddwalls behinddwalls force-pushed the sql-queue-stores branch 2 times, most recently from abe7aee to 3e04b8e Compare February 19, 2026 03:29
@behinddwalls behinddwalls force-pushed the sql-queue-schema-config branch 2 times, most recently from e8b1a30 to c4c3fe6 Compare February 19, 2026 04:02
@behinddwalls behinddwalls force-pushed the sql-queue-schema-config branch from c4c3fe6 to 454d92d Compare February 19, 2026 04:27
@behinddwalls behinddwalls force-pushed the sql-queue-schema-config branch from 454d92d to 7dcf5fb Compare February 19, 2026 04:51
@behinddwalls behinddwalls force-pushed the sql-queue-schema-config branch from 7dcf5fb to fc19779 Compare February 20, 2026 00:17
Base automatically changed from sql-queue-schema-config to main February 20, 2026 00:43
@behinddwalls behinddwalls changed the base branch from main to sql-queue-subscriber February 20, 2026 05:22
Comment thread extensions/queue/sql/offset_store.go Outdated
Comment thread extensions/queue/sql/partition_lease_store.go Outdated
behinddwalls added a commit that referenced this pull request Feb 20, 2026
## Summary
### Why?
Need Publisher implementation to enable message publishing to SQL queue
topics.

### What?

- Publisher validates topic names and publishes single messages via
MessageStore
- Thread-safe with RWMutex for concurrent publish calls
- Idempotent Close() operation
- Comprehensive test coverage for publish, validation, metrics, and
concurrency

- Single and multiple message publishing tested
- Invalid topic names rejected (uppercase, special chars, empty)
- Publisher closed state prevents further publishes
- Concurrent publish operations verified thread-safe
- Context cancellation handled correctly

## Test Plan
make test

## Issues


## Stack
1. @ #22
1. #23
1. #21
1. #24
1. #34
@behinddwalls behinddwalls force-pushed the sql-queue-subscriber branch 2 times, most recently from 752bb37 to bc7b5bb Compare February 20, 2026 21:40
- Add MessageStore implementation for message persistence and retrieval
- Add OffsetStore implementation for consumption offset tracking
- Add PartitionLeaseStore implementation for distributed partition leasing
- Add logging and metrics constants for standardized observability
- Add table name constants (MessagesTableName, OffsetsTableName, etc.) to stores.go
- Add comprehensive integration tests (requires go-mysql-server dependency)
- Support DLQ (dead letter queue) for failed message handling
- Support visibility timeout and retry logic for message processing
@behinddwalls behinddwalls changed the base branch from sql-queue-subscriber to main February 20, 2026 21:57
@behinddwalls behinddwalls merged commit 4c8da50 into main Feb 20, 2026
1 check passed
@behinddwalls behinddwalls deleted the sql-queue-stores branch February 20, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants