feat(processing): 领域/投影/终态三步提交与 FlightProjectionPort(ACM2-79)
PIPELINE_LOCK 跨 Redis 写;MSG_EVENT HELD→PENDING;Redis 失败不终态不投递;V3 迁移。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.gzzn.omms.msgexchange.processing
|
||||
|
||||
import com.gzzn.omms.msgexchange.infra.persistence.MsgEventRepository
|
||||
import com.gzzn.omms.msgexchange.infra.persistence.PipelineLockRepository
|
||||
import com.gzzn.omms.msgexchange.infra.persistence.PipelineTransactionManager
|
||||
import com.gzzn.omms.msgexchange.infra.persistence.ProcStateRepository
|
||||
import com.gzzn.omms.msgexchange.infra.stub.StubFlightProjectionPort
|
||||
import com.gzzn.omms.msgexchange.infra.stub.StubMsgEvents
|
||||
import com.gzzn.omms.msgexchange.infra.stub.StubPipelineLock
|
||||
import com.gzzn.omms.msgexchange.infra.stub.StubPipelineTx
|
||||
import com.gzzn.omms.msgexchange.infra.stub.StubProcState
|
||||
import java.time.Clock
|
||||
|
||||
/**
|
||||
* 处理器用例共用的三步提交装配:默认全内存、投影不失败。
|
||||
* 事件仓储要和处理器用同一个实例,否则放行(`HELD` → `PENDING`)落不到处理器写的那些行上。
|
||||
*/
|
||||
internal fun testCommit(
|
||||
procState: ProcStateRepository = StubProcState(),
|
||||
msgEvents: MsgEventRepository = StubMsgEvents(),
|
||||
projection: FlightProjectionPort = StubFlightProjectionPort(),
|
||||
lock: PipelineLockRepository = StubPipelineLock(),
|
||||
txManager: PipelineTransactionManager = StubPipelineTx(),
|
||||
clock: Clock = Clock.systemUTC(),
|
||||
) = FlightCommit(txManager, lock, procState, msgEvents, projection, clock)
|
||||
Reference in New Issue
Block a user