Permalink
Browse files

Added comments to error-handling Java code.

  • Loading branch information...
1 parent cfef9ec commit fd488f1c9314cce9de534e44acb51a1c48182bce @michael-alford michael-alford committed Jan 31, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/main/java/amqp/spring/camel/component/SpringAMQPConsumer.java
@@ -200,7 +200,13 @@ public void onMessage(Message amqpMessage) {
if(replyToAddress != null) {
org.apache.camel.Message outMessage = exchange.getOut();
SpringAMQPMessage replyMessage = new SpringAMQPMessage(outMessage);
-
+
+ // Camel exchange will contain a non-null exception if an unhandled exception has occurred,
+ // such as when using the DefaultErrorHandler with default configuration, or when
+ // using the DeadLetterChannel error handler with an OnException handled=false override.
+ // Exchange will not contain an exception (via getException()) if the exception has been handled,
+ // such as when using the DeadLetterChannel error handler with default configuration, but
+ // the Exchange property EXCEPTION_CAUGHT will contain the handled exception.
if (exchange.getException() != null) {
replyMessage.setHeader(SpringAMQPMessage.IS_EXCEPTION_CAUGHT, true);
replyMessage.setBody(exchange.getException());

0 comments on commit fd488f1

Please sign in to comment.