turcsanyip commented on code in PR #11243:
URL: https://github.com/apache/nifi/pull/11243#discussion_r3261818062
##########
nifi-extension-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java:
##########
@@ -244,8 +244,10 @@ public final void onTrigger(final ProcessContext context,
final ProcessSession s
context.yield();
closeResource(resource);
} catch (Exception e) {
- getLogger().error("Processor failure", e);
+ getLogger().error("Processor failure, dropping the client", e);
+ session.rollback();
context.yield();
+ closeResource(resource);
}
Review Comment:
OK, I think I understand what I missed here. When `processResource()` throws
a generic exception, the client is still alive but it is no longer available
for the processor because `resourceQueue.offer(resource)` will not be called
due to the exception.
So closing the client seems to be right way. In this case, `basic.nack` in
[NIFI-15892](https://issues.apache.org/jira/browse/NIFI-15892) is not really
needed because it just redelivers the message to the client that cannot work
anymore and will be closed soon. The real remedy is that the client gets closed
and all locally buffered (unacked) messages will be discarded.
--
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]