From commits-return-62336-archive-asf-public=cust-asf.ponee.io@camel.apache.org Fri Apr 6 10:13:21 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 5EC98180649 for ; Fri, 6 Apr 2018 10:13:21 +0200 (CEST) Received: (qmail 4338 invoked by uid 500); 6 Apr 2018 08:13:20 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 4329 invoked by uid 99); 6 Apr 2018 08:13:20 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2018 08:13:20 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id AEB0785036; Fri, 6 Apr 2018 08:13:19 +0000 (UTC) Date: Fri, 06 Apr 2018 08:13:19 +0000 To: "commits@camel.apache.org" Subject: [camel] branch camel-2.20.x updated: SQS Producer support for numeric attributes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <152300239943.18656.18004465285658501551@gitbox.apache.org> From: acosentino@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: camel X-Git-Refname: refs/heads/camel-2.20.x X-Git-Reftype: branch X-Git-Oldrev: 6788dd7412b8f66643590bb845a5a13f0225810e X-Git-Newrev: dcf19c6ea0e40278cfd44f97fd70d6f405dad662 X-Git-Rev: dcf19c6ea0e40278cfd44f97fd70d6f405dad662 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch camel-2.20.x in repository https://gitbox.apache.org/repos/asf/camel.git 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. 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 6268ea8..5fae7f1 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 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 acosentino@apache.org.