servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r702199 - /servicemix/components/bindings/servicemix-file/trunk/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
Date Mon, 06 Oct 2008 16:35:24 GMT
Author: gertv
Date: Mon Oct  6 09:35:24 2008
New Revision: 702199

URL: http://svn.apache.org/viewvc?rev=702199&view=rev
Log:
SM-1605: File poller endpoint should not throw exception when receiving ERROR Exchange

Modified:
    servicemix/components/bindings/servicemix-file/trunk/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java

Modified: servicemix/components/bindings/servicemix-file/trunk/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-file/trunk/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java?rev=702199&r1=702198&r2=702199&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-file/trunk/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
(original)
+++ servicemix/components/bindings/servicemix-file/trunk/src/main/java/org/apache/servicemix/file/FilePollerEndpoint.java
Mon Oct  6 09:35:24 2008
@@ -372,12 +372,15 @@
                             }
                         }
                     } 
-                } else {
+                } else if (exchange.getStatus() == ExchangeStatus.ERROR) {
                     Exception e = exchange.getError();
                     if (e == null) {
-                        e = new JBIException("Unkown error");
+                        throw new JBIException("Received an exchange with status ERROR, but
no exception was set");
                     }
-                    throw e;
+                    logger.warn("Message in file " + aFile + " could not be handled successfully:
" + e.getMessage(), e);
+                } else {
+                    //we should never get an ACTIVE exchange -- the File poller only sends
InOnly exchanges
+                    throw new JBIException("Unexpectedly received an exchange with status
ACTIVE");
                 }
             } finally {
                 // remove the open exchange



Mime
View raw message