rakesh-rsky opened a new pull request, #11213:
URL: https://github.com/apache/nifi/pull/11213
## Summary
PublishAMQP silently routes FlowFiles to success even when the AMQP broker
returns them as undeliverable (e.g., no matching queue/binding). This causes
silent data loss. The fix uses AMQP Publisher Confirms + asic.return to detect
and surface delivery failures.
## Changes
- **AMQPPublisher.java**:
- Added AtomicReference<String> undeliverableReturnReason field.
- Enabled Publisher Confirms (channel.confirmSelect()) in constructor.
- UndeliverableMessageLogger.handleReturn() now captures the return reason
instead of only logging it.
- After asicPublish(), calls channel.waitForConfirmsOrDie(5000) as a
synchronization barrier (the broker guarantees asic.return arrives before the
confirm frame).
- If a return reason was captured, throws AMQPException, which triggers
REL_FAILURE routing in the processor.
## Testing
- Publish to an exchange with no bound queues → FlowFile now routes to
ailure with the broker's return reason in the error attribute.
- Normal publish (queue bound) → still routes to success.
- Existing unit tests pass.
Fixes: https://issues.apache.org/jira/browse/NIFI-15483
--
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]