Skip to content

docs: 013 phase 2 — PostgreSQL for both transport and Outbox - #153

Merged
iancooper merged 1 commit into
masterfrom
docs/013-phase2-postgresql
Sep 7, 2026
Merged

docs: 013 phase 2 — PostgreSQL for both transport and Outbox#153
iancooper merged 1 commit into
masterfrom
docs/013-phase2-postgresql

Conversation

@iancooper

Copy link
Copy Markdown
Member

Spec 013, phase 2. Adds the guide Docs#67 is owed: one PostgreSQL database as both broker and Outbox, so the business write and the message announcing it commit in a single transaction.

contents/PostgreSQLTransportAndOutbox.md — How-to, 358 lines, nine ## Step N: headings, nested under PostgreSQL Message Broker. The pivot is that RelationalDatabaseConfiguration takes queueStoreTable and outBoxTableName as two parameters on one object, so there is no second configuration to reconcile.

The companion sample — Q4 answered yes

BrighterCommand/Brighter#4304 adds GreetingsSenderWithOutbox to the existing PostgresTaskQueue sample and registers it in Brighter.slnx. It extends rather than creates — Greetings and GreetingsReceiverConsole are reused unchanged.

Step 9 is measured, not asserted. The sample was run against docker-compose-postgres.yaml: deposit, Found 1 to clear out of amount 100, Decoupled invocation of message: Topic:greeting.event, then the receiver consumes and deletes it. Run with --fail and the row counts in greeting and outbox are both unchanged, so neither write survived.

Four defects repaired on this guide's own prerequisites

Found by compiling the two pages the new page's banner points at, and none of them in P0-2's or P0-4's scope:

Page The corpus said The compiler says
PostgresOutbox.md:61 GetDDL(tableName, hasBinaryMessagePayload: true) CS1739 — PostgreSql's parameter is binaryMessagePayload; MsSql, MySql and Sqlite are the ones that spell it has…
PostgresOutbox.md:68-95 an example script GetDDL("Outbox") "will generate" a different table — "outbox", Id bigserial PRIMARY KEY, DataRef, SpecVersion, no Created/CreatedID
PostgreSQLMessageBroker.md:91 PostgresProducerRegistryFactory(postgresConfiguration, …) CS1503 — it takes a PostgresMessagingGatewayConnection
PostgreSQLMessageBroker.md:44-55 BIGSERIAL PRIMARY KEY, TIMESTAMP … DEFAULT, JSONB NOT NULL BIGINT GENERATED ALWAYS AS IDENTITY, TIMESTAMPTZ, JSON, index with INCLUDE ("id")

The repaired DDL was printed from the released 10.7.0 package, not from src/origin/master emits a CausationId column and an index that no released version has.

One stale premise corrected

Design §4.1 had the page print InvalidOperationException: No Async outbox defined. (Q&A #3795). Probing it produces something else: ConfigurationException: Unable to register outbox of type PostgreSqlOutbox - no transaction provider has been registered that matches the outbox's transaction type, thrown from AddProducers at registration. That guard was added in Brighter#3952 on 2026-01-19 and ships in 10.7.0, so a V10 reader cannot reach the sweeper message by this route. The page prints the measured exception and names the older one as its historical equivalent, since that is the string still in search results.

Gates

Gate Before After
linkcheck.py 160 161
pagelint.py 158 pages, 773 warnings 159 pages, 772 warnings
urlmap.py --check-shape 157, widest 12 of 20 158, widest 12 of 20
urlmap.py --check-redirects 77 / 7858 bytes unmoved
versioncheck.py 18 pins, 5 pages unmoved
optioncheck 59 tables, 519 rows unmoved

pagelint.py --changed origin/master reports 17 code block(s) strict, 0 errors — the new page's 13 blocks plus the four repaired ones, so the pass is not vacuous.

Full write-up, including six findings the task list did not predict, is in spec/013-howto_guides/tasks.md § Phase 2 as executed. 24 of 43 tasks now ticked.

🤖 Generated with Claude Code

https://claude.ai/code/session_0146UueHL6H3zGBGTYwz7GtL

Adds contents/PostgreSQLTransportAndOutbox.md, the guide Docs#67 is owed:
one PostgreSQL database as broker and Outbox, so the business write and the
message announcing it commit together. Nine steps, a failures section naming
the exceptions by their text, nested under PostgreSQL Message Broker.

Every code block is compiled, and step 9's output is measured on a real run
of the companion sample in BrighterCommand/Brighter#4304 — which extends the
existing PostgresTaskQueue sample and reuses its receiver unchanged.

Four defects repaired on the two pages this guide names as prerequisites,
each found by compiling them and none in P0-2 or P0-4's scope:

  PostgresOutbox.md:61          CS1739 — GetDDL's parameter is
                                binaryMessagePayload on PostgreSql, while
                                MsSql, MySql and Sqlite spell it
                                hasBinaryMessagePayload
  PostgresOutbox.md:68-95       the printed DDL is not what GetDDL emits at
                                10.7.0
  PostgreSQLMessageBroker.md:91 CS1503 — the producer registry factory takes
                                a PostgresMessagingGatewayConnection
  PostgreSQLMessageBroker.md:44 the queue DDL is not what the transport runs

Design §4.1's first named failure was stale: the registration guard added in
Brighter#3952 ships in 10.7.0, so a V10 reader meets a ConfigurationException
from AddProducers rather than the sweeper's "No Async outbox defined." The
page prints the measured exception and names the older one as its historical
equivalent.

Gates: link 160 -> 161, pagelint 158 -> 159 pages and 773 -> 772 warnings,
shape 157 -> 158 with the widest section unmoved at 12 of 20, redirects,
versioncheck and optioncheck all unmoved. --changed reported 17 code blocks
strict, 0 errors.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146UueHL6H3zGBGTYwz7GtL
@iancooper
iancooper merged commit 5cbcb2e into master Sep 7, 2026
8 checks passed
@iancooper
iancooper deleted the docs/013-phase2-postgresql branch September 7, 2026 22:08
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.

1 participant