camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r630774 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
Date Mon, 25 Feb 2008 09:22:29 GMT
Author: jstrachan
Date: Mon Feb 25 01:22:22 2008
New Revision: 630774

URL: http://svn.apache.org/viewvc?rev=630774&view=rev
Log:
applied patch from Steven Marcus from this thread : http://www.nabble.com/seda-broken-in-latest-snapshot-tp15510480s22882p15641995.html

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java?rev=630774&r1=630773&r2=630774&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
Mon Feb 25 01:22:22 2008
@@ -33,6 +33,8 @@
  * @version $Revision$
  */
 public class SedaConsumer extends ServiceSupport implements Consumer, Runnable {
+    private static final transient Log LOG = LogFactory.getLog(SedaConsumer.class);
+
     private SedaEndpoint endpoint;
     private AsyncProcessor processor;
     private Thread thread;
@@ -53,13 +55,21 @@
             try {
                 exchange = endpoint.getQueue().poll(1000, TimeUnit.MILLISECONDS);
             } catch (InterruptedException e) {
-                break;
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Interupted: " + e, e);
+                }
+                continue;
             }
             if (exchange != null && isRunAllowed()) {
-                processor.process(exchange, new AsyncCallback() {
-                    public void done(boolean sync) {
-                    }
-                });
+                try {
+                    processor.process(exchange, new AsyncCallback() {
+                        public void done(boolean sync) {
+                        }
+                    });
+                }
+                catch (Exception e) {
+                    LOG.error("Seda queue caught: " + e, e);
+                }
             }
         }
     }



Mime
View raw message