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:13 UTC
[camel] 24/33: CAMEL-17792: Add doc about the message headers of camel-aws2-sns
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 1da93cbb1ebeba94688d366f52f41746df9d21f8
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Wed Mar 16 15:13:31 2022 +0100
CAMEL-17792: Add doc about the message headers of camel-aws2-sns
---
.../apache/camel/component/aws2/sns/aws2-sns.json | 5 +++++
.../src/main/docs/aws2-sns-component.adoc | 21 +++------------------
.../camel/component/aws2/sns/Sns2Constants.java | 7 +++++++
.../camel/component/aws2/sns/Sns2Endpoint.java | 2 +-
4 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/components/camel-aws/camel-aws2-sns/src/generated/resources/org/apache/camel/component/aws2/sns/aws2-sns.json b/components/camel-aws/camel-aws2-sns/src/generated/resources/org/apache/camel/component/aws2/sns/aws2-sns.json
index ca0162f..e7e78cb 100644
--- a/components/camel-aws/camel-aws2-sns/src/generated/resources/org/apache/camel/component/aws2/sns/aws2-sns.json
+++ b/components/camel-aws/camel-aws2-sns/src/generated/resources/org/apache/camel/component/aws2/sns/aws2-sns.json
@@ -47,6 +47,11 @@
"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.sns.Sns2Configuration", "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.sns.Sns2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
},
+ "headers": {
+ "CamelAwsSnsMessageId": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Amazon SNS message ID." },
+ "CamelAwsSnsSubject": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Amazon SNS message subject. If not set, the subject from the\n`SnsConfiguration` is used." },
+ "CamelAwsSnsMessageStructure": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The message structure to use such as json." }
+ },
"properties": {
"topicNameOrArn": { "kind": "path", "displayName": "Topic Name Or Arn", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Topic name or ARN" },
"amazonSNSClient": { "kind": "parameter", "displayName": "Amazon SNSClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.sns.SnsClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sns.Sns2Configuration", "configurationField": "configuration", "description": "To use the AmazonSNS as the client" },
diff --git a/components/camel-aws/camel-aws2-sns/src/main/docs/aws2-sns-component.adoc b/components/camel-aws/camel-aws2-sns/src/main/docs/aws2-sns-component.adoc
index 364e1d8..4192663 100644
--- a/components/camel-aws/camel-aws2-sns/src/main/docs/aws2-sns-component.adoc
+++ b/components/camel-aws/camel-aws2-sns/src/main/docs/aws2-sns-component.adoc
@@ -72,24 +72,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 evaluated by the SNS producer
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type |Description
-
-|`CamelAwsSnsSubject` |`String` |The Amazon SNS message subject. If not set, the subject from the
-`SnsConfiguration` is used.
-|=======================================================================
-
-=== Message headers set by the SNS producer
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type |Description
-
-|`CamelAwsSnsMessageId` |`String` |The Amazon SNS message ID.
-|=======================================================================
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
=== Advanced AmazonSNS configuration
diff --git a/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Constants.java b/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Constants.java
index 80b9912..61e49ae 100644
--- a/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Constants.java
+++ b/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Constants.java
@@ -16,13 +16,20 @@
*/
package org.apache.camel.component.aws2.sns;
+import org.apache.camel.spi.Metadata;
+
/**
* Constants used in Camel AWS SNS module
*/
public interface Sns2Constants {
+ @Metadata(description = "The Amazon SNS message ID.", javaType = "String")
String MESSAGE_ID = "CamelAwsSnsMessageId";
+ @Metadata(description = "The Amazon SNS message subject. If not set, the subject from the\n" +
+ "`SnsConfiguration` is used.",
+ javaType = "String")
String SUBJECT = "CamelAwsSnsSubject";
+ @Metadata(description = "The message structure to use such as json.", javaType = "String")
String MESSAGE_STRUCTURE = "CamelAwsSnsMessageStructure";
String MESSAGE_GROUP_ID_PROPERTY = "CamelAwsSnsMessageGroupId";
}
diff --git a/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Endpoint.java b/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Endpoint.java
index 1d38fa7..ad584ad 100644
--- a/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Endpoint.java
+++ b/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Endpoint.java
@@ -55,7 +55,7 @@ import software.amazon.awssdk.services.sns.model.Topic;
*/
@UriEndpoint(firstVersion = "3.1.0", scheme = "aws2-sns", title = "AWS Simple Notification System (SNS)",
syntax = "aws2-sns:topicNameOrArn", producerOnly = true,
- category = { Category.CLOUD, Category.MESSAGING, Category.MOBILE })
+ category = { Category.CLOUD, Category.MESSAGING, Category.MOBILE }, headersClass = Sns2Constants.class)
public class Sns2Endpoint extends DefaultEndpoint implements HeaderFilterStrategyAware {
private static final Logger LOG = LoggerFactory.getLogger(Sns2Endpoint.class);