mirror of https://github.com/apache/nifi.git
NIFI-392: Report correct Source System Identifier when receiving data via site-to-site
This commit is contained in:
parent
5e0026c14c
commit
bd74063dde
|
@ -489,11 +489,11 @@ public class SocketFlowFileServerProtocol implements ServerProtocol {
|
||||||
|
|
||||||
final long transferNanos = System.nanoTime() - startNanos;
|
final long transferNanos = System.nanoTime() - startNanos;
|
||||||
final long transferMillis = TimeUnit.MILLISECONDS.convert(transferNanos, TimeUnit.NANOSECONDS);
|
final long transferMillis = TimeUnit.MILLISECONDS.convert(transferNanos, TimeUnit.NANOSECONDS);
|
||||||
final String sourceSystemFlowFileUuid = flowFile.getAttribute(CoreAttributes.UUID.key());
|
final String sourceSystemFlowFileUuid = dataPacket.getAttributes().get(CoreAttributes.UUID.key());
|
||||||
flowFile = session.putAttribute(flowFile, CoreAttributes.UUID.key(), UUID.randomUUID().toString());
|
flowFile = session.putAttribute(flowFile, CoreAttributes.UUID.key(), UUID.randomUUID().toString());
|
||||||
|
|
||||||
final String transitUri = (transitUriPrefix == null) ? peer.getUrl() : transitUriPrefix + sourceSystemFlowFileUuid;
|
final String transitUri = (transitUriPrefix == null) ? peer.getUrl() : transitUriPrefix + sourceSystemFlowFileUuid;
|
||||||
session.getProvenanceReporter().receive(flowFile, transitUri, "urn:nifi:" + sourceSystemFlowFileUuid, "Remote Host=" + peer.getHost() + ", Remote DN=" + remoteDn, transferMillis);
|
session.getProvenanceReporter().receive(flowFile, transitUri, sourceSystemFlowFileUuid == null ? null : "urn:nifi:" + sourceSystemFlowFileUuid, "Remote Host=" + peer.getHost() + ", Remote DN=" + remoteDn, transferMillis);
|
||||||
session.transfer(flowFile, Relationship.ANONYMOUS);
|
session.transfer(flowFile, Relationship.ANONYMOUS);
|
||||||
flowFilesReceived.add(flowFile);
|
flowFilesReceived.add(flowFile);
|
||||||
bytesReceived += flowFile.getSize();
|
bytesReceived += flowFile.getSize();
|
||||||
|
|
Loading…
Reference in New Issue