feat(processing): GTDT FLOP vertical link with real XmlCodec (P2-0)
Add JacksonXmlCodec (XXE-safe META/FLOP parse), GtdtHandler, and unified PipelineHolderFactory; route DNLD/FLOP through FlightStateEngine persistNextStates.
This commit is contained in:
@@ -2,6 +2,7 @@ package com.gzzn.omms.msgexchange.processing
|
||||
|
||||
import com.gzzn.omms.msgexchange.config.PipelineProps
|
||||
import com.gzzn.omms.msgexchange.domain.DecodedMessage
|
||||
import com.gzzn.omms.msgexchange.domain.flight.FlightStateEngine
|
||||
import com.gzzn.omms.msgexchange.domain.ErrorClass
|
||||
import com.gzzn.omms.msgexchange.domain.MsgEvent
|
||||
import com.gzzn.omms.msgexchange.domain.ProcState
|
||||
@@ -222,9 +223,15 @@ class MessageProcessor(
|
||||
decision.schdPush.forEach { add(MsgEvent(target = Targets.KAFKA_SCHD, partitionKey = it.flid, payloadJson = it.payloadJson)) }
|
||||
}
|
||||
|
||||
val messageId = head.cminmsgsId.toString()
|
||||
txManager.inTransaction {
|
||||
if (decision.flightChanges.isNotEmpty()) {
|
||||
flightSchd.upsertIncremental(decision.flightChanges)
|
||||
val nextStates = decision.flightChanges.map { change ->
|
||||
val current = flightSchd.findNextStateByFlid(change.flid)
|
||||
val commands = FlightStateEngine.commandsFromFields(change.flid, change.fields, snapshotReplace = false)
|
||||
FlightStateEngine.apply(current, commands, messageId, bumpVersion = true)
|
||||
}
|
||||
flightSchd.persistNextStates(null, nextStates, snapshotReplace = false)
|
||||
}
|
||||
if (events.isNotEmpty()) {
|
||||
msgEvents.insertAll(events)
|
||||
@@ -232,8 +239,11 @@ class MessageProcessor(
|
||||
procState.update(head.cminmsgsId, ProcStatus.SUCCEEDED)
|
||||
}
|
||||
|
||||
// 提交后:backfill CMINMSGS(共享信箱外部副作用,补偿链路)
|
||||
inbox.backfillOnSuccess(head.cminmsgsId, decoded.meta.sndr, decoded.meta.type, decoded.meta.styp, decoded.meta.seqn)
|
||||
try {
|
||||
inbox.backfillOnSuccess(head.cminmsgsId, decoded.meta.sndr, decoded.meta.type, decoded.meta.styp, decoded.meta.seqn)
|
||||
} catch (e: Exception) {
|
||||
log.error("backfill failed after SUCCEEDED id={} (compensation required)", head.cminmsgsId, e)
|
||||
}
|
||||
log.info("SUCCEEDED id={} events={} flightChanges={}", head.cminmsgsId, events.size, decision.flightChanges.size)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user