diff --git a/src/main/java/com/exactpro/th2/FixHandler.java b/src/main/java/com/exactpro/th2/FixHandler.java index d7d6825..b0d69b0 100644 --- a/src/main/java/com/exactpro/th2/FixHandler.java +++ b/src/main/java/com/exactpro/th2/FixHandler.java @@ -32,6 +32,7 @@ import com.exactpro.th2.conn.dirty.fix.brokenconn.configuration.RecoveryConfig; import com.exactpro.th2.conn.dirty.fix.brokenconn.configuration.ResendRequestConfiguration; import com.exactpro.th2.conn.dirty.fix.brokenconn.configuration.RuleConfiguration; +import com.exactpro.th2.conn.dirty.fix.brokenconn.configuration.SendSequenceResetConfiguration; import com.exactpro.th2.conn.dirty.fix.brokenconn.configuration.SplitSendConfiguration; import com.exactpro.th2.conn.dirty.fix.brokenconn.configuration.TransformMessageConfiguration; import com.exactpro.th2.conn.dirty.fix.brokenconn.configuration.TransformationConfiguration; @@ -1921,12 +1922,19 @@ private void runReconnectWithSequenceResetStrategy(RuleConfiguration configurati private void sendSequenceReset(RuleConfiguration configuration) { strategy.resetStrategyAndState(configuration); Instant start = Instant.now(); + SendSequenceResetConfiguration config = configuration.getSendSequenceResetConfiguration(); StringBuilder sequenceReset = new StringBuilder(); String time = getTime(); setHeader(sequenceReset, MSG_TYPE_SEQUENCE_RESET, msgSeqNum.incrementAndGet(), time); sequenceReset.append(ORIG_SENDING_TIME).append(time); - sequenceReset.append(NEW_SEQ_NO).append(msgSeqNum.get() - 5); + if(config.getChangeUp()) { + int seqNum = msgSeqNum.get(); + sequenceReset.append(NEW_SEQ_NO).append(seqNum + 5); + msgSeqNum.set(seqNum + 5); + } else { + sequenceReset.append(NEW_SEQ_NO).append(msgSeqNum.get() - 5); + } setChecksumAndBodyLength(sequenceReset); channel.send(Unpooled.wrappedBuffer(sequenceReset.toString().getBytes(StandardCharsets.UTF_8)), new HashMap(), null, SendMode.HANDLE_AND_MANGLE) diff --git a/src/main/kotlin/com/exactpro/th2/conn/dirty/fix/brokenconn/configuration/RuleConfiguration.kt b/src/main/kotlin/com/exactpro/th2/conn/dirty/fix/brokenconn/configuration/RuleConfiguration.kt index 633a605..1e188bf 100644 --- a/src/main/kotlin/com/exactpro/th2/conn/dirty/fix/brokenconn/configuration/RuleConfiguration.kt +++ b/src/main/kotlin/com/exactpro/th2/conn/dirty/fix/brokenconn/configuration/RuleConfiguration.kt @@ -39,7 +39,8 @@ data class RuleConfiguration( val batchSendConfiguration: BatchSendConfiguration? = null, val splitSendConfiguration: SplitSendConfiguration? = null, val changeSequenceConfiguration: ChangeSequenceConfiguration? = null, - val resendRequestConfiguration: ResendRequestConfiguration? = null + val resendRequestConfiguration: ResendRequestConfiguration? = null, + val sendSequenceResetConfiguration: SendSequenceResetConfiguration? = null ) { init { when(ruleType) { diff --git a/src/main/kotlin/com/exactpro/th2/conn/dirty/fix/brokenconn/configuration/SendSequenceResetConfiguration.kt b/src/main/kotlin/com/exactpro/th2/conn/dirty/fix/brokenconn/configuration/SendSequenceResetConfiguration.kt new file mode 100644 index 0000000..5b8565d --- /dev/null +++ b/src/main/kotlin/com/exactpro/th2/conn/dirty/fix/brokenconn/configuration/SendSequenceResetConfiguration.kt @@ -0,0 +1,3 @@ +package com.exactpro.th2.conn.dirty.fix.brokenconn.configuration + +data class SendSequenceResetConfiguration(val changeUp: Boolean) \ No newline at end of file