mirror of https://github.com/apache/nifi.git
NIFI-2585: Add attributes to track where a flow file came from when receiving over site-to-site
Signed-off-by: Bryan Bende <bbende@apache.org>
This commit is contained in:
parent
44c9ea0a66
commit
28e5d85493
|
@ -506,6 +506,12 @@ public abstract class AbstractFlowFileServerProtocol implements ServerProtocol {
|
|||
throw new ProtocolException(this + " Received unexpected Response Code from peer " + peer + " : " + confirmTransactionResponse + "; expected 'Confirm Transaction' Response Code");
|
||||
}
|
||||
|
||||
// For routing purposes, downstream consumers often need to reference Flowfile's originating system
|
||||
for (FlowFile flowFile : transaction.getFlowFilesSent()){
|
||||
flowFile = session.putAttribute(flowFile, "remote.host", peer.getHost());
|
||||
flowFile = session.putAttribute(flowFile, "remote.address", peer.getHost() + ":" + peer.getPort());
|
||||
}
|
||||
|
||||
// Commit the session so that we have persisted the data
|
||||
session.commit();
|
||||
|
||||
|
|
Loading…
Reference in New Issue