You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/03/16 19:13:14 UTC

[camel] 25/33: CAMEL-17792: Add doc about the message headers of camel-aws2-sqs

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

nfilotto pushed a commit to branch CAMEL-17792/doc-message-headers
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 4b0adcc9b439c1f18a28dceb47ca787998a5d5b7
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Wed Mar 16 15:29:58 2022 +0100

    CAMEL-17792: Add doc about the message headers of camel-aws2-sqs
---
 .../apache/camel/component/aws2/sqs/aws2-sqs.json  | 10 +++++++
 .../src/main/docs/aws2-sqs-component.adoc          | 31 +++-------------------
 .../camel/component/aws2/sqs/Sqs2Constants.java    | 15 +++++++++++
 .../camel/component/aws2/sqs/Sqs2Endpoint.java     |  3 ++-
 4 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/components/camel-aws/camel-aws2-sqs/src/generated/resources/org/apache/camel/component/aws2/sqs/aws2-sqs.json b/components/camel-aws/camel-aws2-sqs/src/generated/resources/org/apache/camel/component/aws2/sqs/aws2-sqs.json
index fb5ae51..0f2667a 100644
--- a/components/camel-aws/camel-aws2-sqs/src/generated/resources/org/apache/camel/component/aws2/sqs/aws2-sqs.json
+++ b/components/camel-aws/camel-aws2-sqs/src/generated/resources/org/apache/camel/component/aws2/sqs/aws2-sqs.json
@@ -67,6 +67,16 @@
     "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
     "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   },
+  "headers": {
+    "CamelAwsSqsAttributes": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Map<MessageSystemAttributeName, String>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A map of the attributes requested in ReceiveMessage to their respective values." },
+    "CamelAwsSqsMessageAttributes": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Map<String, MessageAttributeValue>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Amazon SQS message attributes." },
+    "CamelAwsSqsMD5OfBody": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The MD5 checksum of the Amazon SQS message." },
+    "CamelAwsSqsMessageId": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Amazon SQS message ID." },
+    "CamelAwsSqsReceiptHandle": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Amazon SQS message receipt handle." },
+    "CamelAwsSqsDelaySeconds": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The delay seconds that the Amazon SQS message can be\nsee by others." },
+    "CamelAwsSqsPrefix": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A string to use for filtering the list results." },
+    "CamelAwsSqsOperation": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation we want to perform" }
+  },
   "properties": {
     "queueNameOrArn": { "kind": "path", "displayName": "Queue Name Or Arn", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Queue name or ARN" },
     "amazonAWSHost": { "kind": "parameter", "displayName": "Amazon AWSHost", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "amazonaws.com", "configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField": "configuration", "description": "The hostname of the Amazon AWS cloud." },
diff --git a/components/camel-aws/camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc b/components/camel-aws/camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc
index 950b1ac..695dd7f 100644
--- a/components/camel-aws/camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc
+++ b/components/camel-aws/camel-aws2-sqs/src/main/docs/aws2-sqs-component.adoc
@@ -77,34 +77,9 @@ You have the possibility of avoiding the usage of explicit static credentials, b
 
 For more information about this you can look at https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html[AWS credentials documentation]
 
-=== Message headers set by the SQS producer
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type |Description
-
-|`CamelAwsSqsMD5OfBody` |`String` |The MD5 checksum of the Amazon SQS message.
-
-|`CamelAwsSqsMessageId` |`String` |The Amazon SQS message ID.
-
-|`CamelAwsSqsDelaySeconds` |`Integer` |The delay seconds that the Amazon SQS message can be
-see by others.
-|=======================================================================
-
-=== Message headers set by the SQS consumer
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type |Description
-
-|`CamelAwsSqsMD5OfBody` |`String` |The MD5 checksum of the Amazon SQS message.
-
-|`CamelAwsSqsMessageId` |`String` |The Amazon SQS message ID. 
-
-|`CamelAwsSqsReceiptHandle` |`String` |The Amazon SQS message receipt handle.
-
-|`CamelAwsSqsMessageAttributes` |`Map<String, String>` |The Amazon SQS message attributes.
-|=======================================================================
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 === Advanced AmazonSQS configuration
 
diff --git a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Constants.java b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Constants.java
index 95faf15..f87141c 100644
--- a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Constants.java
+++ b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Constants.java
@@ -16,19 +16,34 @@
  */
 package org.apache.camel.component.aws2.sqs;
 
+import org.apache.camel.spi.Metadata;
+
 /**
  * Constants used in Camel AWS SQS module
  */
 public interface Sqs2Constants {
 
+    @Metadata(label = "consumer",
+              description = "A map of the attributes requested in ReceiveMessage to their respective values.",
+              javaType = "Map<MessageSystemAttributeName, String>")
     String ATTRIBUTES = "CamelAwsSqsAttributes";
+    @Metadata(label = "consumer", description = "The Amazon SQS message attributes.",
+              javaType = "Map<String, MessageAttributeValue>")
     String MESSAGE_ATTRIBUTES = "CamelAwsSqsMessageAttributes";
+    @Metadata(description = "The MD5 checksum of the Amazon SQS message.", javaType = "String")
     String MD5_OF_BODY = "CamelAwsSqsMD5OfBody";
+    @Metadata(description = "The Amazon SQS message ID.", javaType = "String")
     String MESSAGE_ID = "CamelAwsSqsMessageId";
+    @Metadata(description = "The Amazon SQS message receipt handle.", javaType = "String")
     String RECEIPT_HANDLE = "CamelAwsSqsReceiptHandle";
+    @Metadata(label = "producer", description = "The delay seconds that the Amazon SQS message can be\n" +
+                                                "see by others.",
+              javaType = "Integer")
     String DELAY_HEADER = "CamelAwsSqsDelaySeconds";
     String MESSAGE_GROUP_ID_PROPERTY = "CamelAwsMessageGroupId";
+    @Metadata(description = "A string to use for filtering the list results.", javaType = "String")
     String SQS_QUEUE_PREFIX = "CamelAwsSqsPrefix";
+    @Metadata(description = "The operation we want to perform", javaType = "String")
     String SQS_OPERATION = "CamelAwsSqsOperation";
     String SQS_DELETE_FILTERED = "CamelAwsSqsDeleteFiltered";
 }
diff --git a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Endpoint.java b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Endpoint.java
index 0589321..0b9bc59 100644
--- a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Endpoint.java
+++ b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Endpoint.java
@@ -57,7 +57,8 @@ import software.amazon.awssdk.services.sqs.model.SqsException;
  * Send and receive messages to/from AWS SQS service using AWS SDK version 2.x.
  */
 @UriEndpoint(firstVersion = "3.1.0", scheme = "aws2-sqs", title = "AWS Simple Queue Service (SQS)",
-             syntax = "aws2-sqs:queueNameOrArn", category = { Category.CLOUD, Category.MESSAGING })
+             syntax = "aws2-sqs:queueNameOrArn", category = { Category.CLOUD, Category.MESSAGING },
+             headersClass = Sqs2Constants.class)
 public class Sqs2Endpoint extends ScheduledPollEndpoint implements HeaderFilterStrategyAware {
 
     private static final Logger LOG = LoggerFactory.getLogger(Sqs2Endpoint.class);