nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JPercivall <...@git.apache.org>
Subject [GitHub] nifi pull request #548: NIFI-2045 - Removing mqtt message from queue after a...
Date Tue, 21 Jun 2016 20:45:20 GMT
Github user JPercivall commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/548#discussion_r67948120
  
    --- Diff: nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-processors/src/main/java/org/apache/nifi/processors/mqtt/ConsumeMQTT.java
---
    @@ -289,8 +296,10 @@ public void process(final OutputStream out) throws IOException {
                 String transitUri = new StringBuilder(broker).append(mqttMessage.getTopic()).toString();
                 session.getProvenanceReporter().receive(messageFlowfile, transitUri);
                 session.transfer(messageFlowfile, REL_MESSAGE);
    -            mqttQueue.remove(mqttMessage);
                 session.commit();
    +            if (!mqttQueue.remove(mqttMessage)) {
    +                logger.warn("Mqtt message " + mqttMessage + " had already been removed
from queue, possible duplication of flow files");
    --- End diff --
    
    Thinking through this error message and how it would be useful to a user, I would like
some kind of UUID to output here (like a message id) but there aren't any in MQTT. So I think
it would be better to word the warning a different way by referencing the FlowFile that could
potentially contain duplicate data. By having a warning message with the UUID of the FlowFile
containing potentially duplicate data the user may be able to correlate that using provenance
to find the other FlowFile with duplicate data.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message