[ 
https://issues.apache.org/jira/browse/CAMEL-12425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16428086#comment-16428086
 ] 

ASF GitHub Bot commented on CAMEL-12425:
----------------------------------------

oscerd closed pull request #2282: CAMEL-12425 SQS Producer support for numeric 
attributes
URL: https://github.com/apache/camel/pull/2282
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 04a66e0ca88..231f9b6b7ff 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 String toString() {
                     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());


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> SqsProducer doesn't support Number attributes
> ---------------------------------------------
>
>                 Key: CAMEL-12425
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12425
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-aws
>    Affects Versions: 2.20.2, 2.21.0
>            Reporter: Craig
>            Assignee: Andrea Cosentino
>            Priority: Major
>             Fix For: 2.20.4, 2.21.1, 2.22.0
>
>
> SqsProducer doesn't support Number attributes. It only supports attributes 
> with a value of type String or ByteBuffer.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to