Skip to content

feat(queue/sql): add publisher implementation#22

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

feat(queue/sql): add publisher implementation#22
behinddwalls merged 1 commit into
mainfrom
sql-queue-publisher

Conversation

@behinddwalls
Copy link
Copy Markdown
Collaborator

@behinddwalls behinddwalls commented Feb 17, 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. @ feat(queue/sql): add publisher implementation #22
  2. feat(queue/sql): add subscriber with partition leasing #23
  3. feat(queue/sql): add data access layer stores #21
  4. feat(queue/sql): add factory, tests, and documentation #24
  5. feat(sql/queue): merge DLQ logic into message table #34

@behinddwalls behinddwalls requested review from a team and sbalabanov as code owners February 17, 2026 04:59
@behinddwalls behinddwalls force-pushed the sql-queue-publisher branch 3 times, most recently from 6b9a01f to 74d181d Compare February 19, 2026 03:29
@behinddwalls behinddwalls force-pushed the sql-queue-stores branch 2 times, most recently from 19130c8 to 29df5c6 Compare February 19, 2026 04:27
@behinddwalls behinddwalls force-pushed the sql-queue-publisher branch 2 times, most recently from 1386759 to 3a8459a Compare February 19, 2026 18:56
@behinddwalls behinddwalls changed the base branch from sql-queue-stores to sql-queue-schema-config February 19, 2026 18:56
Comment thread extensions/queue/sql/publisher.go
Comment thread extensions/queue/sql/publisher.go Outdated
Comment thread extensions/queue/sql/publisher.go Outdated
Comment thread extensions/queue/sql/publisher_test.go Outdated
Comment thread extensions/queue/sql/publisher_test.go Outdated
Comment thread extensions/queue/sql/publisher_test.go
@behinddwalls behinddwalls force-pushed the sql-queue-schema-config branch from 7dcf5fb to fc19779 Compare February 20, 2026 00:17
@behinddwalls behinddwalls force-pushed the sql-queue-publisher branch 3 times, most recently from 20d554f to ed4c674 Compare February 20, 2026 00:34
Base automatically changed from sql-queue-schema-config to main February 20, 2026 00:43
@behinddwalls behinddwalls force-pushed the sql-queue-publisher branch 4 times, most recently from 331f173 to d7597af Compare February 20, 2026 05:22
Comment thread extensions/queue/sql/publisher.go Outdated
- Implement Publisher interface with SQL MessageStore backend
- Add gomock-based mocks for MessageStore interface
- Use fixed timestamps in tests for repeatability
- Optimize mutex usage: only lock for closed flag check
- Move logging outside mutex to avoid I/O under lock
- Extract validateTopicName to validation.go for sharing
- Add comprehensive test coverage for publish, close, validation, and concurrency
@behinddwalls behinddwalls merged commit 7371c3c into main Feb 20, 2026
1 check passed
@behinddwalls behinddwalls deleted the sql-queue-publisher branch February 20, 2026 21:57
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