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

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

aldettinger closed pull request #2337: CAMEL-12506 and CAMEL-12507: SQS support 
for boolean and custom number types
URL: https://github.com/apache/camel/pull/2337
 
 
   

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 1ec145b3697..7fe85a989a7 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,9 +135,30 @@ public String toString() {
                     mav.setDataType("Binary");
                     mav.withBinaryValue((ByteBuffer)value);
                     result.put(entry.getKey(), mav);
+                } else if (value instanceof Boolean) {
+                    MessageAttributeValue mav = new MessageAttributeValue();
+                    mav.setDataType("Number.Boolean");
+                    mav.withStringValue(((Boolean)value)?"1":"0");
+                    result.put(entry.getKey(), mav);
                 } else if (value instanceof Number) {
                     MessageAttributeValue mav = new MessageAttributeValue();
-                    mav.setDataType("Number");
+                    final String dataType;
+                    if(value instanceof Integer) {
+                        dataType = "Number.int";
+                    } else if (value instanceof Byte) {
+                        dataType = "Number.byte";
+                    } else if (value instanceof Double) {
+                        dataType = "Number.double";
+                    } else if (value instanceof Float) {
+                        dataType = "Number.float";
+                    } else if (value instanceof Long) {
+                        dataType = "Number.long";
+                    } else if (value instanceof Short) {
+                        dataType = "Number.short";
+                    } else {
+                        dataType = "Number";
+                    }
+                    mav.setDataType(dataType);
                     mav.withStringValue(((Number)value).toString());
                     result.put(entry.getKey(), mav);
                 } else {


 

----------------------------------------------------------------
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:
[email protected]


> SqsProducer doesn't support Boolean attributes
> ----------------------------------------------
>
>                 Key: CAMEL-12506
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12506
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-aws
>    Affects Versions: 2.20.3, 2.21.0
>            Reporter: Craig
>            Priority: Major
>
> SqsProducer doesn't support Boolean attributes.



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

Reply via email to