This is an automated email from the ASF dual-hosted git repository. aldettinger pushed a commit to branch camel-2.20.x in repository https://gitbox.apache.org/repos/asf/camel.git
commit 87935efeab93f118bdc884204329c85aebe3caa6 Author: Craig Andrews <candr...@integralblue.com> AuthorDate: Fri May 11 16:50:17 2018 -0400 CAMEL-12506: SQS Producer support for boolean attributes If a header of type `Boolean` is provided, map it to an SQS `MessageAttributeValue` of type "Number" with the`MessageAttributeValue`'s StringValue being "1" for true and "0" for false. This behavior matches that of amazon-sqs-java-messaging-lib: https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/1.0.4/src/main/java/com/amazon/sqs/javamessaging/message/SQSMessage.java#L1146 See https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html (cherry picked from commit 22556949a2c8ca0d7b0e3078a3b39f067bcf8bc5) --- .../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 4b95772..fe6953a 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 @@ -120,6 +120,11 @@ public class SqsProducer extends DefaultProducer { 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(); final String dataType; -- To stop receiving notification emails like this one, please contact aldettin...@apache.org.