diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/AbstractFlowFileServerProtocol.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/AbstractFlowFileServerProtocol.java index e9f3877592..d97bf9919d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/AbstractFlowFileServerProtocol.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/AbstractFlowFileServerProtocol.java @@ -446,7 +446,11 @@ public abstract class AbstractFlowFileServerProtocol implements ServerProtocol { break; } FlowFile flowFile = session.create(); - flowFile = session.importFrom(dataPacket.getData(), flowFile); + + if (dataPacket.getSize() > 0) { + flowFile = session.importFrom(dataPacket.getData(), flowFile); + } + flowFile = session.putAllAttributes(flowFile, dataPacket.getAttributes()); if (handshakeProperties.isUseGzip()) {