camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [camel] branch camel-2.20.x updated: SQS Producer support for numeric attributes
Date Fri, 06 Apr 2018 08:13:19 GMT
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch camel-2.20.x
in repository

The following commit(s) were added to refs/heads/camel-2.20.x by this push:
     new dcf19c6  SQS Producer support for numeric attributes
dcf19c6 is described below

commit dcf19c6ea0e40278cfd44f97fd70d6f405dad662
Author: Craig Andrews <>
AuthorDate: Thu Apr 5 17:09:30 2018 -0400

    SQS Producer support for numeric attributes
    If a header of type `Number` is provided, map it to an SQS `MessageAttributeValue` of
type "Number" with the`MessageAttributeValue`'s StringValue containing a string representation
of the number.
 .../main/java/org/apache/camel/component/aws/sqs/    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/
index 6268ea8..5fae7f1 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/
@@ -120,6 +120,11 @@ public class SqsProducer extends DefaultProducer {
                     result.put(entry.getKey(), mav);
+                } else if (value instanceof Number) {
+                    MessageAttributeValue mav = new MessageAttributeValue();
+                    mav.setDataType("Number");
+                    mav.withStringValue(((Number)value).toString());
+                    result.put(entry.getKey(), mav);
                 } else {
                     // cannot translate the message header to message attribute value
                     LOG.warn("Cannot put the message header key={}, value={} into Sqs MessageAttribute",
entry.getKey(), entry.getValue());

To stop receiving notification emails like this one, please contact

View raw message