Skip to content

Commit

Permalink
fix strategy resend request on logon gap
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Plotnikov committed Nov 21, 2023
1 parent d17fc47 commit 0cfbdf8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/java/com/exactpro/th2/FixHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,6 @@ public Map<String, String> onIncoming(@NotNull IChannel channel, @NotNull ByteBu
serverMsgSeqNum.set(receivedMsgSeqNum);
}

if(serverMsgSeqNum.get() < receivedMsgSeqNum && !isDup && !enabled.get()) {
if(strategy.getSendResendRequestOnLogonGap() && serverMsgSeqNum.get() > 5 ) {
sendResendRequest(serverMsgSeqNum.get() - 5, 0);
}
}

switch (msgTypeValue) {
case MSG_TYPE_HEARTBEAT:
if (LOGGER.isInfoEnabled()) LOGGER.info("Heartbeat received - {}", message.toString(US_ASCII));
Expand All @@ -569,6 +563,11 @@ public Map<String, String> onIncoming(@NotNull IChannel channel, @NotNull ByteBu
strategy.getState().addMessageID(messageId);strategy.getState().addMessageID(messageId);
Map<String, String> logonMetadata = strategy.getIncomingMessageStrategy(IncomingMessagesStrategy::getLogonStrategy).process(message, metadata);
if (logonMetadata != null) return logonMetadata;
if(serverMsgSeqNum.get() < receivedMsgSeqNum && !isDup && !enabled.get()) {
if(strategy.getSendResendRequestOnLogonGap() && serverMsgSeqNum.get() > 5 ) {
sendResendRequest(serverMsgSeqNum.get() - 5, 0);
}
}
break;
case MSG_TYPE_RESEND_REQUEST:
strategy.getState().addMessageID(messageId);
Expand Down

0 comments on commit 0cfbdf8

Please sign in to comment.