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 0be31ed490a7de8d7c0fbe8316d22436b3d57fa8
Author: Nicolas Filotto <[email protected]>
AuthorDate: Wed Mar 16 10:44:26 2022 +0100

    CAMEL-17792: Add doc about the message headers of camel-aws2-kinesis
---
 .../aws2/firehose/aws2-kinesis-firehose.json       |  5 +++
 .../camel/component/aws2/kinesis/aws2-kinesis.json |  7 ++++
 .../src/main/docs/aws2-kinesis-component.adoc      | 42 ++--------------------
 .../main/docs/aws2-kinesis-firehose-component.adoc | 16 +++------
 .../aws2/firehose/KinesisFirehose2Constants.java   |  7 ++++
 .../aws2/firehose/KinesisFirehose2Endpoint.java    |  3 +-
 .../component/aws2/kinesis/Kinesis2Constants.java  | 11 ++++++
 .../component/aws2/kinesis/Kinesis2Consumer.java   |  2 +-
 .../component/aws2/kinesis/Kinesis2Endpoint.java   |  2 +-
 9 files changed, 41 insertions(+), 54 deletions(-)

diff --git 
a/components/camel-aws/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/firehose/aws2-kinesis-firehose.json
 
b/components/camel-aws/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/firehose/aws2-kinesis-firehose.json
index 5052e07..a8706b9 100644
--- 
a/components/camel-aws/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/firehose/aws2-kinesis-firehose.json
+++ 
b/components/camel-aws/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/firehose/aws2-kinesis-firehose.json
@@ -39,6 +39,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.firehose.KinesisFirehose2Configuration", 
"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.firehose.KinesisFirehose2Configuration", 
"configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   },
+  "headers": {
+    "CamelAwsKinesisFirehoseRecordId": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The record ID, as defined 
in\nhttp:\/\/docs.aws.amazon.com\/firehose\/latest\/APIReference\/API_PutRecord.html#API_PutRecord_ResponseSyntax[Response
 Syntax]" },
+    "CamelAwsKinesisFirehoseOperation": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The operation we want to perform" },
+    "CamelAwsKinesisFirehoseDeliveryStreamName": { "kind": "header", 
"displayName": "", "group": "producer", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "The name of the delivery stream." }
+  },
   "properties": {
     "streamName": { "kind": "path", "displayName": "Stream Name", "group": 
"producer", "label": "", "required": true, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "configurationClass": 
"org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration", 
"configurationField": "configuration", "description": "Name of the stream" },
     "amazonKinesisFirehoseClient": { "kind": "parameter", "displayName": 
"Amazon Kinesis Firehose Client", "group": "producer", "label": "", "required": 
false, "type": "object", "javaType": 
"software.amazon.awssdk.services.firehose.FirehoseClient", "deprecated": false, 
"deprecationNote": "", "autowired": true, "secret": false, 
"configurationClass": 
"org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration", 
"configurationField": "configuration", "description": "Amazon Kines [...]
diff --git 
a/components/camel-aws/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/kinesis/aws2-kinesis.json
 
b/components/camel-aws/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/kinesis/aws2-kinesis.json
index 6902ece..9c6d16a 100644
--- 
a/components/camel-aws/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/kinesis/aws2-kinesis.json
+++ 
b/components/camel-aws/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/kinesis/aws2-kinesis.json
@@ -44,6 +44,13 @@
     "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.kinesis.Kinesis2Configuration", 
"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.kinesis.Kinesis2Configuration", 
"configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   },
+  "headers": {
+    "CamelAwsKinesisSequenceNumber": { "kind": "header", "displayName": "", 
"group": "common", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The sequence number of the record, as defined 
in\nhttp:\/\/docs.aws.amazon.com\/kinesis\/latest\/APIReference\/API_PutRecord.html#API_PutRecord_ResponseSyntax[Response
 Syntax]" },
+    "CamelAwsKinesisApproximateArrivalTimestamp": { "kind": "header", 
"displayName": "", "group": "common", "label": "", "required": false, 
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "The time AWS assigned as the arrival 
time of the record." },
+    "CamelAwsKinesisPartitionKey": { "kind": "header", "displayName": "", 
"group": "common", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "Identifies which shard in the stream the data record is 
assigned to." },
+    "CamelMessageTimestamp": { "kind": "header", "displayName": "", "group": 
"common", "label": "", "required": false, "javaType": "long", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The timestamp of the message" },
+    "CamelAwsKinesisShardId": { "kind": "header", "displayName": "", "group": 
"common", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The shard ID of the shard where the data record was placed." }
+  },
   "properties": {
     "streamName": { "kind": "path", "displayName": "Stream Name", "group": 
"common", "label": "", "required": true, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "configurationClass": 
"org.apache.camel.component.aws2.kinesis.Kinesis2Configuration", 
"configurationField": "configuration", "description": "Name of the stream" },
     "amazonKinesisClient": { "kind": "parameter", "displayName": "Amazon 
Kinesis Client", "group": "common", "label": "", "required": false, "type": 
"object", "javaType": "software.amazon.awssdk.services.kinesis.KinesisClient", 
"deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, 
"configurationClass": 
"org.apache.camel.component.aws2.kinesis.Kinesis2Configuration", 
"configurationField": "configuration", "description": "Amazon Kinesis client to 
use for all reque [...]
diff --git 
a/components/camel-aws/camel-aws2-kinesis/src/main/docs/aws2-kinesis-component.adoc
 
b/components/camel-aws/camel-aws2-kinesis/src/main/docs/aws2-kinesis-component.adoc
index 3124c78..42ccce4 100644
--- 
a/components/camel-aws/camel-aws2-kinesis/src/main/docs/aws2-kinesis-component.adoc
+++ 
b/components/camel-aws/camel-aws2-kinesis/src/main/docs/aws2-kinesis-component.adoc
@@ -78,19 +78,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 Kinesis consumer
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type |Description
-
-|`CamelAwsKinesisSequenceNumber` |`String` |The sequence number of the record. 
This is represented as a String as it
-size is not defined by the API. If it is to be used as a numerical type then 
use
-
-|`CamelAwsKinesisApproximateArrivalTimestamp` |`String` |The time AWS assigned 
as the arrival time of the record.
-
-|`CamelAwsKinesisPartitionKey` |`String` |Identifies which shard in the stream 
the data record is assigned to.
-|=======================================================================
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 === AmazonKinesis configuration
 
@@ -111,32 +101,6 @@ however, a
 different 
http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/AWSCredentialsProvider.html[AWSCredentialsProvider]
 can be specified when calling createClient(...).
 
-=== Message headers used by the Kinesis producer to write to Kinesis.  The 
producer expects that the message body is a `byte[]`.
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type |Description
-
-|`CamelAwsKinesisPartitionKey` |`String` |The PartitionKey to pass to Kinesis 
to store this record.
-
-|`CamelAwsKinesisSequenceNumber` |`String` |Optional paramter to indicate the 
sequence number of this record.
-
-|=======================================================================
-
-=== Message headers set by the Kinesis producer on successful storage of a 
Record
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type |Description
-
-|`CamelAwsKinesisSequenceNumber` |`String` |The sequence number of the record, 
as defined in
-http://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecord.html#API_PutRecord_ResponseSyntax[Response
 Syntax]
-
-|`CamelAwsKinesisShardId` |`String` |The shard ID of where the Record was 
stored
-
-
-|=======================================================================
-
 == Dependencies
 
 Maven users will need to add the following dependency to their pom.xml.
diff --git 
a/components/camel-aws/camel-aws2-kinesis/src/main/docs/aws2-kinesis-firehose-component.adoc
 
b/components/camel-aws/camel-aws2-kinesis/src/main/docs/aws2-kinesis-firehose-component.adoc
index 94faeb6..988ef77 100644
--- 
a/components/camel-aws/camel-aws2-kinesis/src/main/docs/aws2-kinesis-firehose-component.adoc
+++ 
b/components/camel-aws/camel-aws2-kinesis/src/main/docs/aws2-kinesis-firehose-component.adoc
@@ -89,6 +89,10 @@ 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]
 
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
+
 === Amazon Kinesis Firehose configuration
 
 You then have to reference the FirehoseClient in the 
`amazonKinesisFirehoseClient` URI option.
@@ -144,18 +148,6 @@ 
from("direct:start").to("aws2-kinesis-firehose://cc?amazonKinesisFirehoseClient=
 
 In the deliveryStream you'll find "Test1Test2".
 
-=== Message headers set by the Kinesis producer on successful storage of a 
Record
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type |Description
-
-|`CamelAwsKinesisFirehoseRecordId` |`String` |The record ID, as defined in
-http://docs.aws.amazon.com/firehose/latest/APIReference/API_PutRecord.html#API_PutRecord_ResponseSyntax[Response
 Syntax]
-
-
-|=======================================================================
-
 == Dependencies
 
 Maven users will need to add the following dependency to their pom.xml.
diff --git 
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Constants.java
 
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Constants.java
index 6261e67..bb64a31 100644
--- 
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Constants.java
+++ 
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Constants.java
@@ -16,9 +16,16 @@
  */
 package org.apache.camel.component.aws2.firehose;
 
+import org.apache.camel.spi.Metadata;
+
 public interface KinesisFirehose2Constants {
 
+    @Metadata(description = "The record ID, as defined in\n" +
+                            
"http://docs.aws.amazon.com/firehose/latest/APIReference/API_PutRecord.html#API_PutRecord_ResponseSyntax[Response
 Syntax]",
+              javaType = "String")
     String RECORD_ID = "CamelAwsKinesisFirehoseRecordId";
+    @Metadata(description = "The operation we want to perform", javaType = 
"String")
     String KINESIS_FIREHOSE_OPERATION = "CamelAwsKinesisFirehoseOperation";
+    @Metadata(description = "The name of the delivery stream.", javaType = 
"String")
     String KINESIS_FIREHOSE_STREAM_NAME = 
"CamelAwsKinesisFirehoseDeliveryStreamName";
 }
diff --git 
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Endpoint.java
 
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Endpoint.java
index c4f03f0..e8e3130 100644
--- 
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Endpoint.java
+++ 
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Endpoint.java
@@ -35,7 +35,8 @@ import static 
software.amazon.awssdk.core.SdkSystemSetting.CBOR_ENABLED;
 @UriEndpoint(firstVersion = "3.2.0", scheme = "aws2-kinesis-firehose", title = 
"AWS Kinesis Firehose",
              syntax = "aws2-kinesis-firehose:streamName", producerOnly = true, 
category = {
                      Category.CLOUD,
-                     Category.MESSAGING })
+                     Category.MESSAGING },
+             headersClass = KinesisFirehose2Constants.class)
 public class KinesisFirehose2Endpoint extends DefaultEndpoint {
 
     @UriParam
diff --git 
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Constants.java
 
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Constants.java
index b09aac9..62abfc4 100644
--- 
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Constants.java
+++ 
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Constants.java
@@ -16,14 +16,25 @@
  */
 package org.apache.camel.component.aws2.kinesis;
 
+import org.apache.camel.Exchange;
+import org.apache.camel.spi.Metadata;
+
 public interface Kinesis2Constants {
 
+    @Metadata(description = "The sequence number of the record, as defined 
in\n" +
+                            
"http://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecord.html#API_PutRecord_ResponseSyntax[Response
 Syntax]",
+              javaType = "String")
     String SEQUENCE_NUMBER = "CamelAwsKinesisSequenceNumber";
+    @Metadata(description = "The time AWS assigned as the arrival time of the 
record.", javaType = "String")
     String APPROX_ARRIVAL_TIME = "CamelAwsKinesisApproximateArrivalTimestamp";
+    @Metadata(description = "Identifies which shard in the stream the data 
record is assigned to.", javaType = "String")
     String PARTITION_KEY = "CamelAwsKinesisPartitionKey";
+    @Metadata(description = "The timestamp of the message", javaType = "long")
+    String MESSAGE_TIMESTAMP = Exchange.MESSAGE_TIMESTAMP;
 
     /**
      * in a Kinesis Record object, the shard ID is used on writes to indicate 
where the data was stored
      */
+    @Metadata(description = "The shard ID of the shard where the data record 
was placed.", javaType = "String")
     String SHARD_ID = "CamelAwsKinesisShardId";
 }
diff --git 
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java
 
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java
index b5934a0..1925b6a 100644
--- 
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java
+++ 
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Consumer.java
@@ -197,7 +197,7 @@ public class Kinesis2Consumer extends 
ScheduledBatchPollingConsumer implements R
         exchange.getIn().setHeader(Kinesis2Constants.SEQUENCE_NUMBER, 
record.sequenceNumber());
         if (record.approximateArrivalTimestamp() != null) {
             long ts = record.approximateArrivalTimestamp().getEpochSecond() * 
1000;
-            exchange.getIn().setHeader(Exchange.MESSAGE_TIMESTAMP, ts);
+            exchange.getIn().setHeader(Kinesis2Constants.MESSAGE_TIMESTAMP, 
ts);
         }
         return exchange;
     }
diff --git 
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Endpoint.java
 
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Endpoint.java
index eab1212..a8e52ac 100644
--- 
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Endpoint.java
+++ 
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Endpoint.java
@@ -34,7 +34,7 @@ import static 
software.amazon.awssdk.core.SdkSystemSetting.CBOR_ENABLED;
  * Consume and produce records from and to AWS Kinesis Streams using AWS SDK 
version 2.x.
  */
 @UriEndpoint(firstVersion = "3.2.0", scheme = "aws2-kinesis", title = "AWS 
Kinesis", syntax = "aws2-kinesis:streamName",
-             category = { Category.CLOUD, Category.MESSAGING })
+             category = { Category.CLOUD, Category.MESSAGING }, headersClass = 
Kinesis2Constants.class)
 public class Kinesis2Endpoint extends ScheduledPollEndpoint {
 
     @UriParam

Reply via email to