camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [2/4] git commit: CAMEL-7473 CAMEL-7673 Put the topic name into the message header
Date Fri, 29 Aug 2014 09:20:34 GMT
CAMEL-7473 CAMEL-7673 Put the topic name into the message header


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

Branch: refs/heads/master
Commit: 621aaa4a7239cd17ad30a85db52ec1a70874efd2
Parents: 05c75b2
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Fri Aug 29 14:46:20 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Fri Aug 29 17:20:01 2014 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java    | 2 +-
 .../main/java/org/apache/camel/component/mqtt/MQTTProducer.java    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/621aaa4a/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java
b/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java
index 9c8dd95..651049c 100644
--- a/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java
+++ b/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java
@@ -85,7 +85,7 @@ public class MQTTEndpoint extends DefaultEndpoint {
                 if (!consumers.isEmpty()) {
                     Exchange exchange = createExchange();
                     exchange.getIn().setBody(body.toByteArray());
-                    exchange.setProperty(MQTTConfiguration.MQTT_SUBSCRIBE_TOPIC, topic.toString());
+                    exchange.getIn().setHeader(MQTTConfiguration.MQTT_SUBSCRIBE_TOPIC, topic.toString());
                     for (MQTTConsumer consumer : consumers) {
                         consumer.processExchange(exchange);
                     }

http://git-wip-us.apache.org/repos/asf/camel/blob/621aaa4a/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTProducer.java
b/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTProducer.java
index 86dad19..59ff90b 100644
--- a/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTProducer.java
+++ b/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTProducer.java
@@ -48,7 +48,7 @@ public class MQTTProducer extends DefaultAsyncProducer implements Processor
{
             // where should we publish to
             String topicName = configuration.getPublishTopicName();
             // get the topic name by using the header of MQTT_PUBLISH_TOPIC
-            Object topicValue = exchange.getProperty(MQTTConfiguration.MQTT_PUBLISH_TOPIC);
+            Object topicValue = exchange.getIn().getHeader(MQTTConfiguration.MQTT_PUBLISH_TOPIC);
             if (topicValue != null) {
                 topicName = topicValue.toString();
             }


Mime
View raw message