Skip to content

Commit

Permalink
Correct POSS_RESEND strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
denis.plotnikov committed Dec 18, 2024
1 parent 3144927 commit e073a50
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/com/exactpro/th2/FixHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -1811,16 +1811,20 @@ private Map<String, String> fakeRetransmissionOutgoingProcessor(ByteBuf message,
}

private Map<String, String> possDupOutgoingProcessor(ByteBuf message, Map<String, String> metadata) {
onOutgoingUpdateTag(message, metadata);

ByteBuf copyMessage = asExpandable(Unpooled.copiedBuffer(message));
onOutgoingUpdateTag(copyMessage, metadata);

Set<String> disableForMessageTypes = strategy.getDisableForMessageTypes();
FixField msgTypeField = findField(message, MSG_TYPE_TAG, US_ASCII);
FixField msgTypeField = findField(copyMessage, MSG_TYPE_TAG, US_ASCII);
if(msgTypeField != null && msgTypeField.getValue() != null && disableForMessageTypes.contains(msgTypeField.getValue())) {
LOGGER.info("Strategy '{}' is disabled for {} message type", strategy.getType(), msgTypeField.getValue());
return null;
}

channel.send(asExpandable(Unpooled.copiedBuffer(message)), metadata, null, SendMode.DIRECT);
channel.send(copyMessage, metadata, null, SendMode.DIRECT);

onOutgoingUpdateTag(message, metadata);

FixField sendingTime = requireNonNull(findField(message, SENDING_TIME_TAG));

Expand Down

0 comments on commit e073a50

Please sign in to comment.