spakky-outbox¶
spakky-outbox는 Integration Event를 transaction 바깥으로 안전하게 전달하기 위한 Outbox 계약을 제공합니다.
Outbox 패턴 — 이벤트 발행 보장
플러그인 진입점¶
spakky.outbox.main
¶
Plugin initialization entry point.
initialize(app)
¶
Initialize the Outbox plugin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app
|
SpakkyApplication
|
The Spakky application instance. |
required |
Source code in core/spakky-outbox/src/spakky/outbox/main.py
options: show_root_heading: false
EventBus¶
spakky.outbox.bus.outbox_event_bus
¶
Outbox Event Bus — sync and async implementations replacing IEventBus/IAsyncEventBus via @Primary.
OutboxEventBus(storage, propagator, auth_snapshot_headers=None)
¶
Bases: IEventBus
Intercepts integration events and stores them in the Outbox table (sync).
Replaces the default DirectEventBus so that events are persisted atomically within the same database transaction as the business data.
Source code in core/spakky-outbox/src/spakky/outbox/bus/outbox_event_bus.py
AsyncOutboxEventBus(storage, propagator, auth_snapshot_headers=None)
¶
Bases: IAsyncEventBus
Intercepts integration events and stores them in the Outbox table (async).
Replaces the default AsyncDirectEventBus so that events are persisted atomically within the same database transaction as the business data.
Source code in core/spakky-outbox/src/spakky/outbox/bus/outbox_event_bus.py
options: show_root_heading: false
포트¶
spakky.outbox.ports.storage
¶
Outbox storage port.
IOutboxStorage
¶
options: show_root_heading: false
Relay¶
spakky.outbox.relay
¶
Outbox relay module.
options: show_root_heading: false
spakky.outbox.relay.relay
¶
Outbox Relay Background Services (sync and async).
OutboxRelayBackgroundService(storage, transport, config)
¶
Bases: AbstractBackgroundService
Polls the Outbox storage and relays pending messages to the transport (sync).
Initialize with storage, transport, and config dependencies.
Source code in core/spakky-outbox/src/spakky/outbox/relay/relay.py
AsyncOutboxRelayBackgroundService(storage, transport, config)
¶
Bases: AbstractAsyncBackgroundService
Polls the Outbox storage and relays pending messages to the transport (async).
Initialize with async storage, transport, and config dependencies.
Source code in core/spakky-outbox/src/spakky/outbox/relay/relay.py
initialize_async()
async
¶
dispose_async()
async
¶
run_async()
async
¶
Poll the outbox storage and relay pending messages asynchronously.
Source code in core/spakky-outbox/src/spakky/outbox/relay/relay.py
options: show_root_heading: false
공통¶
spakky.outbox.common.config
¶
Outbox configuration.
OutboxConfig()
¶
Bases: BaseSettings
Outbox plugin configuration loaded from environment variables.
Load outbox configuration from environment variables.
Source code in core/spakky-outbox/src/spakky/outbox/common/config.py
options: show_root_heading: false
spakky.outbox.common.message
¶
Outbox message model.
OutboxMessage(id, event_name, payload, headers, created_at, published_at=None, retry_count=0, claimed_at=None)
dataclass
¶
Persistence-agnostic Outbox message model.
options: show_root_heading: false
에러¶
options: show_root_heading: false
추가 모듈¶
Outbox Relay Background Services (sync and async).
OutboxRelayBackgroundService(storage, transport, config)
¶
Bases: AbstractBackgroundService
Polls the Outbox storage and relays pending messages to the transport (sync).
Initialize with storage, transport, and config dependencies.
Source code in core/spakky-outbox/src/spakky/outbox/relay/relay.py
AsyncOutboxRelayBackgroundService(storage, transport, config)
¶
Bases: AbstractAsyncBackgroundService
Polls the Outbox storage and relays pending messages to the transport (async).
Initialize with async storage, transport, and config dependencies.
Source code in core/spakky-outbox/src/spakky/outbox/relay/relay.py
initialize_async()
async
¶
dispose_async()
async
¶
run_async()
async
¶
Poll the outbox storage and relay pending messages asynchronously.
Source code in core/spakky-outbox/src/spakky/outbox/relay/relay.py
Plugin initialization entry point.
initialize(app)
¶
Initialize the Outbox plugin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app
|
SpakkyApplication
|
The Spakky application instance. |
required |