You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2015/10/24 10:25:42 UTC
camel git commit: CAMEL-9101: RabbitMQ specific message properties
are forwarded as message headers
Repository: camel
Updated Branches:
refs/heads/master 880c31cd1 -> 2866a6348
CAMEL-9101: RabbitMQ specific message properties are forwarded as message headers
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2866a634
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2866a634
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2866a634
Branch: refs/heads/master
Commit: 2866a63487ee3efc8d41f7ead1f4cbf18e9b4464
Parents: 880c31c
Author: Andrea Cosentino <an...@gmail.com>
Authored: Sat Oct 24 10:22:20 2015 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Sat Oct 24 10:22:20 2015 +0200
----------------------------------------------------------------------
.../rabbitmq/RabbitMQMessageConverter.java | 27 ++++++++++----------
1 file changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/2866a634/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java
index 4d8f35c..66299f6 100644
--- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java
+++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQMessageConverter.java
@@ -87,67 +87,67 @@ public class RabbitMQMessageConverter {
msg = exchange.getIn();
}
- final Object contentType = msg.getHeader(RabbitMQConstants.CONTENT_TYPE);
+ final Object contentType = msg.removeHeader(RabbitMQConstants.CONTENT_TYPE);
if (contentType != null) {
properties.contentType(contentType.toString());
}
- final Object priority = msg.getHeader(RabbitMQConstants.PRIORITY);
+ final Object priority = msg.removeHeader(RabbitMQConstants.PRIORITY);
if (priority != null) {
properties.priority(Integer.parseInt(priority.toString()));
}
- final Object messageId = msg.getHeader(RabbitMQConstants.MESSAGE_ID);
+ final Object messageId = msg.removeHeader(RabbitMQConstants.MESSAGE_ID);
if (messageId != null) {
properties.messageId(messageId.toString());
}
- final Object clusterId = msg.getHeader(RabbitMQConstants.CLUSTERID);
+ final Object clusterId = msg.removeHeader(RabbitMQConstants.CLUSTERID);
if (clusterId != null) {
properties.clusterId(clusterId.toString());
}
- final Object replyTo = msg.getHeader(RabbitMQConstants.REPLY_TO);
+ final Object replyTo = msg.removeHeader(RabbitMQConstants.REPLY_TO);
if (replyTo != null) {
properties.replyTo(replyTo.toString());
}
- final Object correlationId = msg.getHeader(RabbitMQConstants.CORRELATIONID);
+ final Object correlationId = msg.removeHeader(RabbitMQConstants.CORRELATIONID);
if (correlationId != null) {
properties.correlationId(correlationId.toString());
}
- final Object deliveryMode = msg.getHeader(RabbitMQConstants.DELIVERY_MODE);
+ final Object deliveryMode = msg.removeHeader(RabbitMQConstants.DELIVERY_MODE);
if (deliveryMode != null) {
properties.deliveryMode(Integer.parseInt(deliveryMode.toString()));
}
- final Object userId = msg.getHeader(RabbitMQConstants.USERID);
+ final Object userId = msg.removeHeader(RabbitMQConstants.USERID);
if (userId != null) {
properties.userId(userId.toString());
}
- final Object type = msg.getHeader(RabbitMQConstants.TYPE);
+ final Object type = msg.removeHeader(RabbitMQConstants.TYPE);
if (type != null) {
properties.type(type.toString());
}
- final Object contentEncoding = msg.getHeader(RabbitMQConstants.CONTENT_ENCODING);
+ final Object contentEncoding = msg.removeHeader(RabbitMQConstants.CONTENT_ENCODING);
if (contentEncoding != null) {
properties.contentEncoding(contentEncoding.toString());
}
- final Object expiration = msg.getHeader(RabbitMQConstants.EXPIRATION);
+ final Object expiration = msg.removeHeader(RabbitMQConstants.EXPIRATION);
if (expiration != null) {
properties.expiration(expiration.toString());
}
- final Object appId = msg.getHeader(RabbitMQConstants.APP_ID);
+ final Object appId = msg.removeHeader(RabbitMQConstants.APP_ID);
if (appId != null) {
properties.appId(appId.toString());
}
- final Object timestamp = msg.getHeader(RabbitMQConstants.TIMESTAMP);
+ final Object timestamp = msg.removeHeader(RabbitMQConstants.TIMESTAMP);
if (timestamp != null) {
properties.timestamp(new Date(Long.parseLong(timestamp.toString())));
}
@@ -157,7 +157,6 @@ public class RabbitMQMessageConverter {
// TODO: Add support for a HeaderFilterStrategy. See: org.apache.camel.component.jms.JmsBinding#shouldOutputHeader
for (Map.Entry<String, Object> header : headers.entrySet()) {
-
// filter header values.
Object value = getValidRabbitMQHeaderValue(header.getValue());
if (value != null) {