[
https://issues.apache.org/jira/browse/CAMEL-24934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18118340#comment-18118340
]
Andrea Cosentino commented on CAMEL-24934:
------------------------------------------
PR opened: https://github.com/apache/camel/pull/26779
Three defects in the same two files, one commit each. Each was verified by
reverting it and re-running - the three reverts produce exactly the three
matching test failures.
For CAMEL-16073 note the redelivery-timing change called out in the PR and the
upgrade guide: a negative acknowledgement removes the message from the client
unacked tracker, so redelivery follows negativeAckRedeliveryDelayMicros (60s)
instead of ackTimeoutMillis (10s in this component).
----
_Claude Code on behalf of oscerd (Andrea Cosentino)._
> camel-pulsar - a failed acknowledgement is reported without its cause
> ---------------------------------------------------------------------
>
> Key: CAMEL-24934
> URL: https://issues.apache.org/jira/browse/CAMEL-24934
> Project: Camel
> Issue Type: Bug
> Components: camel-pulsar
> Reporter: Andrea Cosentino
> Assignee: Andrea Cosentino
> Priority: Minor
>
> h3. Summary
> When acknowledging a message fails, the consumer hands
> {{exchange.getException()}} to the exception
> handler, and on that branch it is {{null}} by construction. The real cause is
> dropped.
> h3. Details
> {{PulsarMessageListener.processAsync}}:
> {code:java}
> if (exchange.getException() != null) {
> pulsarConsumer.getExceptionHandler().handleException("Error processing
> exchange", exchange,
> exchange.getException());
> } else {
> try {
> acknowledge(consumer, message);
> } catch (Exception e) {
> pulsarConsumer.getExceptionHandler().handleException("Error
> processing exchange", exchange,
> exchange.getException());
> }
> }
> {code}
> The {{catch}} sits in the {{else}} of {{exchange.getException() != null}}, so
> {{exchange.getException()}}
> is {{null}} there and the caught {{e}} is never used. A failing
> acknowledgement - a closed consumer, an
> unreachable broker, an acknowledgement timeout - is therefore reported with
> no cause and no stack trace,
> and the message will be redelivered later with nothing in the log explaining
> why.
> h3. Proposed fix
> Pass {{e}}, and give the message its own wording so the two branches are
> distinguishable in a log.
> ----
> _Reported by Claude Code on behalf of oscerd (Andrea Cosentino)._
--
This message was sent by Atlassian Jira
(v8.20.10#820010)