This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit cab1869674d98d6843b9b62f247389b178369eea
Author: Craig Andrews <candr...@integralblue.com>
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.
    
    See 
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html
---
 .../main/java/org/apache/camel/component/aws/sqs/SqsProducer.java    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java
 
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java
index 04a66e0..231f9b6 100644
--- 
a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java
+++ 
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java
@@ -135,6 +135,11 @@ public class SqsProducer extends DefaultProducer {
                     mav.setDataType("Binary");
                     mav.withBinaryValue((ByteBuffer)value);
                     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
acosent...@apache.org.

Reply via email to