camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1349332 - in /camel/branches/camel-2.9.x: ./ components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOnlyInvalidDestinationTest.java
Date Tue, 12 Jun 2012 13:32:29 GMT
Author: davsclaus
Date: Tue Jun 12 13:32:29 2012
New Revision: 1349332

URL: http://svn.apache.org/viewvc?rev=1349332&view=rev
Log:
CAMEL-5363: Fixed jms producer to trigger Camel error handling if invalid destination during
destination resolution failed.

Added:
    camel/branches/camel-2.9.x/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOnlyInvalidDestinationTest.java
      - copied unchanged from r1349330, camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOnlyInvalidDestinationTest.java
Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1349330

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java?rev=1349332&r1=1349331&r2=1349332&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
Tue Jun 12 13:32:29 2012
@@ -123,12 +123,20 @@ public class JmsProducer extends Default
             return true;
         }
 
-        if (!endpoint.isDisableReplyTo() && exchange.getPattern().isOutCapable())
{
-            // in out requires a bit more work than in only
-            return processInOut(exchange, callback);
-        } else {
-            // in only
-            return processInOnly(exchange, callback);
+        try {
+            if (!endpoint.isDisableReplyTo() && exchange.getPattern().isOutCapable())
{
+                // in out requires a bit more work than in only
+                return processInOut(exchange, callback);
+            } else {
+                // in only
+                return processInOnly(exchange, callback);
+            }
+        } catch (Throwable e) {
+            // must catch exception to ensure callback is invoked as expected
+            // to let Camel error handling deal with this
+            exchange.setException(e);
+            callback.done(true);
+            return true;
         }
     }
 



Mime
View raw message