Skip to content

feat(queue/sql): add factory, tests, and documentation#24

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

feat(queue/sql): add factory, tests, and documentation#24
behinddwalls merged 1 commit into
mainfrom
sql-queue-integration

Conversation

@behinddwalls
Copy link
Copy Markdown
Collaborator

@behinddwalls behinddwalls commented Feb 17, 2026

Summary

Why?

Need to integrate publisher and subscriber with Queue factory interface and provide comprehensive documentation and end-to-end testing.

What?

  • Factory creates publisher and subscriber singletons with lifecycle management
  • Comprehensive README with usage examples and architecture docs

Test Plan

Issues

Stack

  1. @ feat(queue/sql): add factory, tests, and documentation #24
  2. feat(sql/queue): merge DLQ logic into message table #34
  3. test(queue/sql): add comprehensive e2e integration tests #35

@behinddwalls behinddwalls requested review from a team and sbalabanov as code owners February 17, 2026 04:59
@behinddwalls behinddwalls force-pushed the sql-queue-integration branch 2 times, most recently from a15f2b1 to e0d857c Compare February 17, 2026 22:19
@behinddwalls behinddwalls force-pushed the sql-queue-subscriber branch 2 times, most recently from 07c58fe to 9de4a23 Compare February 18, 2026 00:34
@behinddwalls behinddwalls force-pushed the sql-queue-integration branch 2 times, most recently from e6dd227 to d42e9fb Compare February 19, 2026 03:29
@behinddwalls behinddwalls force-pushed the sql-queue-subscriber branch 2 times, most recently from 010ac2e to d0f0ae6 Compare February 19, 2026 04:02
Comment thread extensions/queue/sql/e2e_test.go Outdated
}()

// Wait for server to be ready
time.Sleep(100 * time.Millisecond)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

flaky

Comment thread extensions/queue/sql/e2e_test.go Outdated

// Start server in background
go func() {
s.Start()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

goroutine needs collection

Comment thread extensions/queue/sql/sql.go Outdated
Comment thread extensions/queue/sql/sql.go Outdated
Comment thread extensions/queue/sql/sql.go Outdated
Comment thread extensions/queue/sql/factory.go Outdated

if f.subscriber != nil {
if err := f.subscriber.Close(); err != nil {
errs = append(errs, err)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can do errors.Join or fmt.Errorf("%w %w")

@behinddwalls behinddwalls force-pushed the sql-queue-subscriber branch 2 times, most recently from aca4bfe to fcccb0c Compare February 20, 2026 03:40
@behinddwalls behinddwalls changed the base branch from sql-queue-subscriber to sql-queue-stores February 20, 2026 05:22
@behinddwalls behinddwalls changed the title feat(queue/sql): add factory, E2E tests, and documentation feat(queue/sql): add factory, tests, and documentation Feb 20, 2026
Comment thread extensions/queue/sql/sql.go
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
Base automatically changed from sql-queue-stores to main February 20, 2026 22:30
Add Factory implementation (sql.go) for SQL queue that provides Publisher
and Subscriber instances with proper lifecycle management.
@behinddwalls behinddwalls merged commit c449bbe into main Feb 20, 2026
1 check passed
@behinddwalls behinddwalls deleted the sql-queue-integration branch June 2, 2026 18:39
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