Skip to content

Commit

Permalink
Adjust recovery end conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
denis.plotnikov committed Oct 8, 2024
1 parent 58027a7 commit 0d69bcb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/com/exactpro/th2/FixHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -905,14 +905,15 @@ private void recovery(int beginSeqNo, int endSeqNo, RecoveryConfig recoveryConfi
LOGGER.info("Dropping recovery message. SeqNum is less than BeginSeqNo: {}", buf.toString(US_ASCII));
return true;
}

if(sequence > endSeq) {
LOGGER.info("Finishing recovery. SeqNum > EndSeq: {}", buf.toString(US_ASCII));
return false;
}

if(recoveryConfig.getSequenceResetForAdmin() && ADMIN_MESSAGES.contains(msgType)) {
LOGGER.info("Dropping recovery message. Admin message sequence reset: {}", buf.toString(US_ASCII));
return true;
return sequence != endSeq;
}
FixField possDup = findField(buf, POSS_DUP_TAG);
if(possDup != null && Objects.equals(possDup.getValue(), IS_POSS_DUP)) return true;
Expand Down Expand Up @@ -964,7 +965,7 @@ private void recovery(int beginSeqNo, int endSeqNo, RecoveryConfig recoveryConfi
resetHeartbeatTask();

lastProcessedSequence.set(sequence);
return true;
return sequence != endSeq;
};

// waiting for messages to be writen in cradle
Expand Down Expand Up @@ -1673,8 +1674,8 @@ private Map<String, String> corruptMessageStructureProcessor(ByteBuf message, Ma

CorruptMessageStructureConfiguration config = strategy.getCorruptMessageStructureConfiguration();
FIXMessageStructureMutator mutator = new FIXMessageStructureMutator(
config.getHeaderTags(),
config.getTrailerTags()
config.getHeaderTags(),
config.getTrailerTags()
);
if (config.getMoveHeaderConfiguration() != null) {
mutator.moveHeader(config.getMoveHeaderConfiguration().getPosition(), message);
Expand Down

0 comments on commit 0d69bcb

Please sign in to comment.