Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 1.32 KB

File metadata and controls

30 lines (23 loc) · 1.32 KB
title component reviewed related
Combining PostgreSQL Persistence and Transport
SqlPersistence
2024-06-14
persistence/sql/dialect-postgresql
transports/postgresql

When using SQL persistence using the PostgreSQL dialect in combination with the PostgreSQL transport, the location of saga data depends both on whether the outbox is enabled and on the transaction mode.

Outbox disabled

PostgreSQL Transport
TransactionMode
Connection sharing Saga data location
SendsAtomicWithReceive isolated transaction for send and receive Transport DB
ReceiveOnly isolated transaction for receive Transport DB
None No transactions Persistence DB

With the outbox disabled, the persistence uses the connection and transaction context established by the transport to access saga data. This behavior ensures exactly-once message processing, since the state change of a saga is committed atomically with the consumption of the message that caused it.

partial: Connection

Outbox enabled

PostgreSQL Transport
TransactionMode
Connection sharing Saga data location
SendsAtomicWithReceive Not supported N/A
ReceiveOnly via Transport storage context Persistence DB
None Not supported N/A