refactor(eventbus): extract shared outbox dispatcher behind a store port - #221
Merged
Conversation
Move the transactional-outbox dispatch pipeline (the dispatcher, the claimed event and dispatch summary types, and the dispatch settings) out of the ledger service into libs/fincore-eventbus behind a new OutboxStore port. The ledger OutboxClaimStore now implements that port with its transaction boundary unchanged, and the ledger wires the shared dispatcher from its own properties. This lets a second service relay its own outbox through the same dispatcher instead of copying it. Behaviour is unchanged: the dispatcher body, the topic and key formulas, the lease and retry logic, and the publish-outside-transaction boundary are preserved, and the existing ledger dispatcher integration tests cover it. Closes #210
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.
What
Third slice of E-02. Behaviour-preserving refactor that extracts the transactional-outbox dispatch pipeline from
services/ledgerintolibs/fincore-eventbus(com.fincore.eventbus.outbox) behind anOutboxStoreport, so the payments service (#211) can relay its own outbox through the same dispatcher instead of copying it (the #195 hazard).OutboxStoreport (claim/markPublished/markFailed),ClaimedEvent/DispatchSummary,OutboxDispatchSettings(defaults equal to the old ledger properties),OutboxDispatcher(moved verbatim, parameterized by the port + settings).OutboxClaimStorenow implementsOutboxStore(bodies unchanged,@Component/@Transactionalintact so the publish-outside-transaction boundary is preserved);OutboxDispatchConfigwires the shared dispatcher, mapping every field fromOutboxDispatcherProperties; the ledger-local dispatcher and claimed-event types are deleted.Cleanup and metrics stay ledger-local (cleanup is multi-table, service-specific); the write-side publisher interface is deferred to #211 where it gains a second real consumer.
Gates
Local (
-x integrationTest)::libs:fincore-eventbus:{test,detekt,spotlessCheck,assemble}+:services:ledger:{test,detekt,detektTest,spotlessCheck,assemble,compileIntegrationTestKotlin}green. critic GO, security-auditor PASS (INV-1 publish-outside-tx + INV-2 lease/at-least-once preserved, verified by byte-diff), evaluator 0.91. The ledger dispatcher ITs run on CI and prove no behaviour change.Closes #210