CAMEL-24083: camel-sjms - Use consumer exception handler for async failures - #24722
Conversation
…ilures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet
left a comment
There was a problem hiding this comment.
Same fix as #24721 (spring-rabbitmq) applied to camel-sjms — both EndpointMessageListener implementations had the identical silent-error-swallowing pattern.
DefaultEndpoint.exceptionHandler is null by default, so the old if (endpoint.getExceptionHandler() != null) guard was effectively a no-op for async errors. Switching to consumer.getExceptionHandler() (always initialized to LoggingExceptionHandler in DefaultConsumer) ensures errors are never silently dropped, and the exchange context is passed through for diagnostics.
Claude Code review on behalf of @gnodet. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 11 tested, 29 compile-only — current: 11 all testedMaveniverse Scalpel detected 40 affected modules (current approach: 11).
|
oscerd
left a comment
There was a problem hiding this comment.
LGTM. Switching from the endpoint's exception handler to consumer.getExceptionHandler().handleException("Error processing exchange", exchange, rce) for the async-completion failure path is the right call — it routes through the consumer's configured exception handler and carries the exchange context (and message) into the handler, which the old endpoint-handler overload dropped. Consistent with the sibling fix in camel-spring-rabbitmq (#24721). CI green.
Reviewed with Claude Code on behalf of Andrea Cosentino. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
Claude Code on behalf of davsclaus
Summary
Same bug as CAMEL-24069 (camel-spring-rabbitmq), but in camel-sjms.
When
asyncConsumer=trueand an exchange fails after the listener returns (async completion), the failure was silently dropped becauseEndpointMessageListenercalledendpoint.getExceptionHandler()which isnullby default, with no fallback.The fix uses
consumer.getExceptionHandler()instead, which always has a defaultLoggingExceptionHandler(set byDefaultConsumerconstructor). This matches the canonical pattern used byDefaultConsumer.DefaultConsumerCallbackand other components like camel-pulsar.Changes
EndpointMessageListener.java(camel-sjms): Changed the async failure path fromendpoint.getExceptionHandler()(nullable, no fallback) toconsumer.getExceptionHandler()(always non-null)Test plan
mvn verify— 4 tests, 0 failures)