feat(ingress): 实现 JDBC 信箱轮询、入站持久化与对拍测试 (U05)
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
package com.gzzn.omms.msgexchange.config
|
||||
|
||||
import io.micronaut.context.annotation.ConfigurationProperties
|
||||
import java.time.Duration
|
||||
|
||||
/**
|
||||
* ACMA-8 参数表(v4)初值;阶段 0 现网基线校准。
|
||||
* U03(N02):Micronaut 要求嵌套配置类同样标注 @ConfigurationProperties,否则 msgx.pipeline/schd/
|
||||
* identity/consistency-check.* 全部静默回落 Kotlin 默认值(当前 yml 初值与默认值一致,现象被掩盖)。
|
||||
*/
|
||||
@ConfigurationProperties("msgx")
|
||||
class PipelineProps {
|
||||
var phase: Phase = Phase.A
|
||||
var serviceName: String = "msgexchangeapi"
|
||||
var registerEureka: Boolean = true
|
||||
var pipeline: Pipeline = Pipeline()
|
||||
var schd: Schd = Schd()
|
||||
var identity: Identity = Identity()
|
||||
var consistencyCheck: ConsistencyCheck = ConsistencyCheck()
|
||||
|
||||
enum class Phase { A, B }
|
||||
|
||||
@ConfigurationProperties("pipeline")
|
||||
class Pipeline {
|
||||
var pollInterval: Duration = Duration.ofSeconds(1) // KEEP 现役节奏
|
||||
var claimBatch: Int = 50
|
||||
var maxAttempts: Int = 5 // 处理/投递同值
|
||||
var backoffMs: List<Long> = listOf(1000, 2000, 4000, 8000, 16000)
|
||||
var backoffCapMs: Long = 60_000
|
||||
var headDeadline: Duration = Duration.ofMinutes(10) // 最坏 HOL 上界(毒丸升级)
|
||||
|
||||
/** U07:启动即拉起 Pump/Dispatcher 循环(默认关——需要真实仓储或 msgx.stubs=true 才可安全开启)。 */
|
||||
var autostart: Boolean = false
|
||||
|
||||
/** N28:attempt ≤ 0(如 FAILED 未递增 attempts 的行)不得抛异常,取下界=首档退避。 */
|
||||
fun backoffFor(attempt: Int): Long {
|
||||
val index = (attempt - 1).coerceAtLeast(0)
|
||||
return backoffMs.getOrNull(index)?.coerceAtMost(backoffCapMs) ?: backoffCapMs
|
||||
}
|
||||
}
|
||||
|
||||
@ConfigurationProperties("schd")
|
||||
class Schd {
|
||||
var flushPeriod: Duration = Duration.ofSeconds(3) // KEEP 现役节律
|
||||
var flushLimit: Int = 500
|
||||
}
|
||||
|
||||
@ConfigurationProperties("identity")
|
||||
class Identity {
|
||||
/** CONFIRM(矩阵 #11):SEQN 重置作用域确认前保持 false,计算集中此处(I3)。 */
|
||||
var includeDayBoundary: Boolean = false
|
||||
}
|
||||
|
||||
@ConfigurationProperties("consistency-check")
|
||||
class ConsistencyCheck {
|
||||
var onStartup: Boolean = true // 阶段 A 必选哨兵
|
||||
var dailySampleRatio: Double = 0.01
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user