tpalfy commented on code in PR #8160:
URL: https://github.com/apache/nifi/pull/8160#discussion_r1465309276


##########
nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/main/java/org/apache/nifi/snmp/processors/SendTrapSNMP.java:
##########
@@ -147,17 +158,18 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession process
                 attributes.put("enterpriseOid", enterpriseOid);
                 attributes.put("genericTrapType", genericTrapType);
                 attributes.put("specificTrapType", specificTrapType);
-                snmpHandler.sendTrap(attributes, v1TrapConfiguration);
+                snmpHandler.sendTrap(attributes, v1TrapConfiguration, target);
             } else {
                 final String trapOidValue = 
context.getProperty(V2TrapProperties.TRAP_OID_VALUE).evaluateAttributeExpressions(flowFile).getValue();
                 V2TrapConfiguration v2TrapConfiguration = new 
V2TrapConfiguration(trapOidValue);
                 attributes.put("trapOidValue", trapOidValue);
-                snmpHandler.sendTrap(attributes, v2TrapConfiguration);
+                snmpHandler.sendTrap(attributes, v2TrapConfiguration, target);
             }
-
-            processSession.putAllAttributes(flowFile, attributes);
+            flowFile = processSession.putAllAttributes(flowFile, attributes);
             processSession.transfer(flowFile, REL_SUCCESS);
-
+            if (isFlowFileReceived) {
+                processSession.getProvenanceReporter().receive(flowFile, 
"/sendTrap");
+            }

Review Comment:
   I think we don't need to add a provenance event explicitly. No data (not 
even attribute) is getting value from any outside sources. Instead, an 
ATTRIBUTES_UPDATED will be generated automatically.
   
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to