Fixed SendProcessor to set exception on exchange in async process method if not started
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c5530acb Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c5530acb Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c5530acb Branch: refs/heads/master Commit: c5530acb5bd04f7f1bc9428c99222fb8b5f62cae Parents: fea576f Author: Claus Ibsen <davscl...@apache.org> Authored: Thu May 30 13:50:35 2013 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Thu May 30 14:36:18 2013 +0200 ---------------------------------------------------------------------- .../org/apache/camel/processor/SendProcessor.java | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/c5530acb/camel-core/src/main/java/org/apache/camel/processor/SendProcessor.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/processor/SendProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/SendProcessor.java index eb8e97c..56f1f6e 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/SendProcessor.java +++ b/camel-core/src/main/java/org/apache/camel/processor/SendProcessor.java @@ -105,7 +105,9 @@ public class SendProcessor extends ServiceSupport implements AsyncProcessor, Tra public boolean process(Exchange exchange, final AsyncCallback callback) { if (!isStarted()) { - throw new IllegalStateException("SendProcessor has not been started: " + this); + exchange.setException(new IllegalStateException("SendProcessor has not been started: " + this)); + callback.done(true); + return true; } // we should preserve existing MEP so remember old MEP