From e073a50c5718995057362fb979261d25b38a3df8 Mon Sep 17 00:00:00 2001 From: "denis.plotnikov" Date: Wed, 18 Dec 2024 13:32:35 +0300 Subject: [PATCH] Correct POSS_RESEND strategy --- src/main/java/com/exactpro/th2/FixHandler.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/exactpro/th2/FixHandler.java b/src/main/java/com/exactpro/th2/FixHandler.java index 52749df..617bd41 100644 --- a/src/main/java/com/exactpro/th2/FixHandler.java +++ b/src/main/java/com/exactpro/th2/FixHandler.java @@ -1811,16 +1811,20 @@ private Map fakeRetransmissionOutgoingProcessor(ByteBuf message, } private Map possDupOutgoingProcessor(ByteBuf message, Map metadata) { - onOutgoingUpdateTag(message, metadata); + + ByteBuf copyMessage = asExpandable(Unpooled.copiedBuffer(message)); + onOutgoingUpdateTag(copyMessage, metadata); Set 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));