Skip to content

Commit

Permalink
[SMXCOMP-956]use one thread directly rather than the threadpool as th…
Browse files Browse the repository at this point in the history
…is method actually get invoked only once

git-svn-id: https://svn.apache.org/repos/asf/servicemix/components/trunk@1415561 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
ffang committed Nov 30, 2012
1 parent 0b57b76 commit 82a1db9
Showing 1 changed file with 10 additions and 8 deletions.
Expand Up @@ -320,12 +320,12 @@ protected void doStart() throws Exception {

if (doPoll) {
synchronized (this.polling) {
consumerExecutor.execute(new Runnable() {
new Thread() {
public void run() {
poller = Thread.currentThread();
pollDeliveryChannel();
}
});
}.start();
polling.wait();
}
}
Expand Down Expand Up @@ -385,13 +385,15 @@ public void run() {
}
}
if (oldStatus == ExchangeStatus.ACTIVE) {
newExchange.setStatus(ExchangeStatus.ERROR);
if (t instanceof RejectedExecutionException) {
if (t.getMessage() == null || t.getMessage().length() == 0) {
t = new RuntimeException("Task rejected from java.util.concurrent.ThreadPoolExecutor, need bigger ThreadPool", t);
}
newExchange.setStatus(ExchangeStatus.ERROR);
if (t instanceof RejectedExecutionException) {
if (t.getMessage() == null || t.getMessage().length() == 0) {
t = new RuntimeException(
"Task rejected from java.util.concurrent.ThreadPoolExecutor, need bigger ThreadPool",
t);
}
newExchange.setError(t instanceof Exception ? (Exception) t : new Exception(t));
}
newExchange.setError(t instanceof Exception ? (Exception)t : new Exception(t));
channel.send(newExchange);
}
} catch (Exception inner) {
Expand Down

0 comments on commit 82a1db9

Please sign in to comment.