When down-method of SERIALIZE creates a new message it puts the serialized headers in the payload and copies the flags. However, it doesn't copy transient flags. We are trying to use TransientFlag DONT_LOOPBACK but since we are also using SERIALIZE, the transient flag gets lost before the message reaches TP. This causes TP to loop back the message even if the original message had DONT_LOOPBACK set. We can set discard_own_messages on the Channel so we don't receive the loop back. However, before that the loop back goes up the stack which messes up the message statistics. The looped back messages are included in the received bytes.
Of course, we can easily fix this by replacing SERIALIZE with our own implementation. However, I was wondering whether this is a bug in SERIALIZE or an intentional feature,
regards,
Antti