You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/03/02 18:51:33 UTC

camel git commit: Fixed an issue spotted from https://github.com/apache/camel/commit/464c06eac4ab7155e016ab72541525d0d2a2e77e#commitcomment-9989261

Repository: camel
Updated Branches:
  refs/heads/master d33af55d6 -> 73b69af70


Fixed an issue spotted from https://github.com/apache/camel/commit/464c06eac4ab7155e016ab72541525d0d2a2e77e#commitcomment-9989261


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/73b69af7
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/73b69af7
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/73b69af7

Branch: refs/heads/master
Commit: 73b69af702ace1ed4dbb52b58260c073d3ddcd66
Parents: d33af55
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Mar 2 18:52:46 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Mar 2 18:52:46 2015 +0100

----------------------------------------------------------------------
 .../camel/component/rabbitmq/RabbitMQConsumer.java   | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/73b69af7/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java
index 73aa814..a4a6362 100644
--- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java
+++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConsumer.java
@@ -184,13 +184,6 @@ public class RabbitMQConsumer extends DefaultConsumer {
             Exchange exchange = consumer.endpoint.createRabbitExchange(envelope, properties, body);
             mergeAmqpProperties(exchange, properties);
 
-            Message msg;
-            if (exchange.hasOut()) {
-                msg = exchange.getOut();
-            } else {
-                msg = exchange.getIn();
-            }
-
             boolean sendReply = properties.getReplyTo() != null;
             if (sendReply && !exchange.getPattern().isOutCapable()) {
                 exchange.setPattern(ExchangePattern.InOut);
@@ -204,6 +197,14 @@ public class RabbitMQConsumer extends DefaultConsumer {
                 exchange.setException(e);
             }
 
+            // obtain the message after processing
+            Message msg;
+            if (exchange.hasOut()) {
+                msg = exchange.getOut();
+            } else {
+                msg = exchange.getIn();
+            }
+
             if (!exchange.isFailed()) {
                 // processing success
                 if (sendReply && exchange.getPattern().isOutCapable()) {