You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/09/14 10:22:37 UTC

[camel-kamelets] 02/03: Support Subject as header into sns fifo sink

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

acosentino pushed a commit to branch aws-sns-fifo-subject
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 94801f8194af88926ffb9b3d3434b9e1063e1136
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Sep 14 12:18:50 2021 +0200

    Support Subject as header into sns fifo sink
---
 .../resources/kamelets/aws-sns-fifo-sink.kamelet.yaml | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/library/camel-kamelets/src/main/resources/kamelets/aws-sns-fifo-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/aws-sns-fifo-sink.kamelet.yaml
index 6eee7a1..0c19c75 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/aws-sns-fifo-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/aws-sns-fifo-sink.kamelet.yaml
@@ -13,7 +13,12 @@ metadata:
 spec:
   definition:
     title: AWS SNS FIFO Sink
-    description: Send message to an AWS SNS FIFO Topic
+    description: |- 
+      Send message to an AWS SNS FIFO Topic
+
+      The Kamelet expects the following headers to be set:
+
+      - `subject` / `ce-subject`: the subject of the message
     required:
       - topicNameOrArn
       - accessKey
@@ -66,6 +71,18 @@ spec:
     from:
       uri: kamelet:source
       steps:
+      - choice:
+          when:
+          - simple: "${header[subject]}"
+            steps:
+            - set-header:
+                name: CamelAwsSnsSubject
+                simple: "${header[subject]}"
+          - simple: "${header[ce-subject]}"
+            steps:
+            - set-header:
+                name: CamelAwsSnsSubject
+                simple: "${header[ce-subject]}"
       - set-property:
           name: contentBasedDeduplication
           constant: "{{contentBasedDeduplication}}"