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 cde3b57fded49b963e754b8e1bbbaf751f502d14
Author: Nicolas Filotto <[email protected]>
AuthorDate: Wed Mar 16 20:05:37 2022 +0100

    CAMEL-17792: Add doc about the message headers of camel-azure-storage-queue
---
 .../azure/storage/queue/azure-storage-queue.json   | 18 ++++++++++
 .../main/docs/azure-storage-queue-component.adoc   | 34 ++-----------------
 .../azure/storage/queue/QueueConstants.java        | 39 ++++++++++++++++++++++
 .../azure/storage/queue/QueueEndpoint.java         |  3 +-
 4 files changed, 62 insertions(+), 32 deletions(-)

diff --git 
a/components/camel-azure/camel-azure-storage-queue/src/generated/resources/org/apache/camel/component/azure/storage/queue/azure-storage-queue.json
 
b/components/camel-azure/camel-azure-storage-queue/src/generated/resources/org/apache/camel/component/azure/storage/queue/azure-storage-queue.json
index be50f7d..86efe68 100644
--- 
a/components/camel-azure/camel-azure-storage-queue/src/generated/resources/org/apache/camel/component/azure/storage/queue/azure-storage-queue.json
+++ 
b/components/camel-azure/camel-azure-storage-queue/src/generated/resources/org/apache/camel/component/azure/storage/queue/azure-storage-queue.json
@@ -38,6 +38,24 @@
     "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.azure.storage.queue.QueueConfiguration", 
"configurationField": "configuration", "description": "Access key for the 
associated azure account name to be used for authentication with azure queue 
services" },
     "credentials": { "kind": "property", "displayName": "Credentials", 
"group": "security", "label": "security", "required": false, "type": "object", 
"javaType": "com.azure.storage.common.StorageSharedKeyCredential", 
"deprecated": false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.azure.storage.queue.QueueConfiguration", 
"configurationField": "configuration", "description": 
"StorageSharedKeyCredential can be injected to create the azure client,  [...]
   },
+  "headers": {
+    "CamelAzureStorageQueueRawHttpHeaders": { "kind": "header", "displayName": 
"", "group": "common", "label": "", "required": false, "javaType": 
"HttpHeaders", "deprecated": false, "deprecationNote": "", "autowired": false, 
"secret": false, "description": "Returns non-parsed httpHeaders that can be 
used by the user." },
+    "CamelAzureStorageQueueMetadata": { "kind": "header", "displayName": "", 
"group": "producer", "label": "producer", "required": false, "javaType": 
"Map<String,String>", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "(createQueue) Metadata to associate 
with the queue" },
+    "CamelAzureStorageQueueMessageId": { "kind": "header", "displayName": "", 
"group": "common", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The ID of the message." },
+    "CamelAzureStorageQueueInsertionTime": { "kind": "header", "displayName": 
"", "group": "common", "label": "", "required": false, "javaType": 
"OffsetDateTime", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "The time the Message was inserted into 
the Queue." },
+    "CamelAzureStorageQueueExpirationTime": { "kind": "header", "displayName": 
"", "group": "common", "label": "", "required": false, "javaType": 
"OffsetDateTime", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "The time that the Message will expire 
and be automatically deleted." },
+    "CamelAzureStorageQueuePopReceipt": { "kind": "header", "displayName": "", 
"group": "producer", "label": "producer", "required": false, "javaType": 
"String", "deprecated": false, "deprecationNote": "", "autowired": false, 
"secret": false, "description": "(deleteMessage, updateMessage) Unique 
identifier that must match for the message to be deleted or updated. If 
deletion fails using this pop receipt then the message has been dequeued by 
another client." },
+    "CamelAzureStorageQueueTimeNextVisible": { "kind": "header", 
"displayName": "", "group": "common", "label": "", "required": false, 
"javaType": "OffsetDateTime", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "description": "The time that the message 
will again become visible in the Queue." },
+    "CamelAzureStorageQueueDequeueCount": { "kind": "header", "displayName": 
"", "group": "common", "label": "", "required": false, "javaType": "long", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The number of times the message has been dequeued." },
+    "CamelAzureStorageQueueOperation": { "kind": "header", "displayName": "", 
"group": "producer", "label": "producer", "required": false, "javaType": 
"org.apache.camel.component.azure.storage.queue.QueueOperationDefinition", 
"enum": [ "listQueues", "createQueue", "deleteQueue", "clearQueue", 
"sendMessage", "deleteMessage", "receiveMessages", "peekMessages", 
"updateMessage" ], "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "(All) Specify t [...]
+    "CamelAzureStorageQueueName": { "kind": "header", "displayName": "", 
"group": "producer", "label": "producer", "required": false, "javaType": 
"String", "deprecated": false, "deprecationNote": "", "autowired": false, 
"secret": false, "description": "(All) Override the queue name." },
+    "CamelAzureStorageQueueSegmentOptions": { "kind": "header", "displayName": 
"", "group": "producer", "label": "producer", "required": false, "javaType": 
"QueuesSegmentOptions", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "description": "(listQueues) Options for 
listing queues" },
+    "CamelAzureStorageQueueTimeout": { "kind": "header", "displayName": "", 
"group": "producer", "label": "producer", "required": false, "javaType": 
"Duration", "deprecated": false, "deprecationNote": "", "autowired": false, 
"secret": false, "description": "(All) An optional timeout value beyond which a 
`RuntimeException` will be raised." },
+    "CamelAzureStorageQueueMaxMessages": { "kind": "header", "displayName": 
"", "group": "producer", "label": "producer", "required": false, "javaType": 
"Integer", "deprecated": false, "deprecationNote": "", "autowired": false, 
"secret": false, "description": "(receiveMessages, peekMessages) Maximum number 
of messages to get, if there are less messages exist in the queue than 
requested all the messages will be returned. If left empty only 1 message will 
be retrieved, the allowed range is [...]
+    "CamelAzureStorageQueueVisibilityTimeout": { "kind": "header", 
"displayName": "", "group": "producer", "label": "producer", "required": false, 
"javaType": "Duration", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": false, "description": "(sendMessage, 
receiveMessages, updateMessage) The timeout period for how long the message is 
invisible in the queue. If unset the value will default to 0 and the message 
will be instantly visible. The timeout must be between [...]
+    "CamelAzureStorageQueueTimeToLive": { "kind": "header", "displayName": "", 
"group": "producer", "label": "producer", "required": false, "javaType": 
"Duration", "deprecated": false, "deprecationNote": "", "autowired": false, 
"secret": false, "description": "(sendMessage) How long the message will stay 
alive in the queue. If unset the value will default to 7 days, if -1 is passed 
the message will not expire. The time to live must be -1 or any positive 
number." },
+    "CamelAzureStorageQueueCreateQueue": { "kind": "header", "displayName": 
"", "group": "producer", "label": "producer", "required": false, "javaType": 
"boolean", "deprecated": false, "deprecationNote": "", "autowired": false, 
"secret": false, "description": "(sendMessage) When is set to `true`, the queue 
will be automatically created when sending messages to the queue." }
+  },
   "properties": {
     "accountName": { "kind": "path", "displayName": "Account Name", "group": 
"common", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"configurationClass": 
"org.apache.camel.component.azure.storage.queue.QueueConfiguration", 
"configurationField": "configuration", "description": "Azure account name to be 
used for authentication with azure queue services" },
     "queueName": { "kind": "path", "displayName": "Queue Name", "group": 
"common", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"configurationClass": 
"org.apache.camel.component.azure.storage.queue.QueueConfiguration", 
"configurationField": "configuration", "description": "The queue resource name" 
},
diff --git 
a/components/camel-azure/camel-azure-storage-queue/src/main/docs/azure-storage-queue-component.adoc
 
b/components/camel-azure/camel-azure-storage-queue/src/main/docs/azure-storage-queue-component.adoc
index 2e2ab27..0b9aa18 100644
--- 
a/components/camel-azure/camel-azure-storage-queue/src/main/docs/azure-storage-queue-component.adoc
+++ 
b/components/camel-azure/camel-azure-storage-queue/src/main/docs/azure-storage-queue-component.adoc
@@ -88,37 +88,9 @@ 
from("azure-storage-queue://storageAccount/messageQueue?accessKey=yourAccessKey"
 to("file://queuedirectory");
 
--------------------------------------------------------------------------------
 
-=== Message headers evaluated by the component producer
-[width="100%",cols="10%,10%,10%,10%,60%",options="header",]
-|=======================================================================
-|Header |Variable Name |Type |Operations |Description
-
-|`CamelAzureStorageQueueSegmentOptions`| 
`QueueConstants.QUEUES_SEGMENT_OPTIONS`|`QueuesSegmentOptions`|`listQueues`|Options
 for listing queues
-|`CamelAzureStorageQueueTimeout`|`QueueConstants.TIMEOUT`|`Duration`|All|An 
optional timeout value beyond which a {@link RuntimeException} will be raised.
-|`CamelAzureStorageQueueMetadata`|`QueueConstants.METADATA`|`Map<String,String>`|`createQueue`|Metadata
 to associate with the queue
-|`CamelAzureStorageQueueTimeToLive`|`QueueConstants.TIME_TO_LIVE`|`Duration`|`sendMessage`|How
 long the message will stay alive in the queue. If unset the value will default 
to 7 days, if -1 is passed the message will not expire. The time to live must 
be -1 or any positive number.
-|`CamelAzureStorageQueueVisibilityTimeout`|`QueueConstants.VISIBILITY_TIMEOUT`|`Duration`|`sendMessage`,
 `receiveMessages`, `updateMessage`| The timeout period for how long the 
message is invisible in the queue. If unset the value will default to 0 and the 
message will be instantly visible. The timeout must be between 0 seconds and 7 
days.
-|`CamelAzureStorageQueueCreateQueue`|`QueueConstants.CREATE_QUEUE`|`boolean`|`sendMessage`|
 When is set to `true`, the queue will be automatically created when sending 
messages to the queue.
-|`CamelAzureStorageQueuePopReceipt`|`QueueConstants.POP_RECEIPT`|`String`|`deleteMessage`,
 `updateMessage`|Unique identifier that must match for the message to be 
deleted or updated.
-|`CamelAzureStorageQueueMessageId`|`QueueConstants.MESSAGE_ID`|`String`|`deleteMessage`,
 `updateMessage`| The ID of the message to be deleted or updated.
-|`CamelAzureStorageQueueMaxMessages`|`QueueConstants.MAX_MESSAGES`|`Integer`|`receiveMessages`,
 `peekMessages`|  Maximum number of messages to get, if there are less messages 
exist in the queue than requested all the messages will be returned. If left 
empty only 1 message will be retrieved, the allowed range is 1 to 32 messages.
-|`CamelAzureStorageQueueOperation`|`QueueConstants.QUEUE_OPERATION`|`QueueOperationDefinition`|All|Specify
 the producer operation to execute, please see the doc on this page related to 
producer operation.
-|`CamelAzureStorageQueueName`|`QueueConstants.QUEUE_NAME`|`String`|All| 
Override the queue name.
-|=======================================================================
-
-
-=== Message headers set by either component producer or consumer
-[width="100%",cols="10%,10%,10%,70%",options="header",]
-|=======================================================================
-|Header |Variable Name |Type |Description
-|`CamelAzureStorageQueueMessageId`|`QueueConstants.MESSAGE_ID`|`String`| The 
ID of message that being sent to the queue.
-|`CamelAzureStorageQueueInsertionTime`|`QueueConstants.INSERTION_TIME`|`OffsetDateTime`|The
 time the Message was inserted into the Queue.
-|`CamelAzureStorageQueueExpirationTime`|`QueueConstants.EXPIRATION_TIME`|`OffsetDateTime`|The
 time that the Message will expire and be automatically deleted.
-|`CamelAzureStorageQueuePopReceipt`|`QueueConstants.POP_RECEIPT`|`String`|This 
value is required to delete/update the Message. If deletion fails using this 
popreceipt then the message has been dequeued by another client.
-|`CamelAzureStorageQueueTimeNextVisible`|`QueueConstants.TIME_NEXT_VISIBLE`|`OffsetDateTime`|The
 time that the message will again become visible in the Queue.
-|`CamelAzureStorageQueueDequeueCount` | 
`QueueConstants.DEQUEUE_COUNT`|`long`|The number of times the message has been 
dequeued.
-|`CamelAzureStorageQueueRawHttpHeaders`|`QueueConstants.RAW_HTTP_HEADERS`|`HttpHeaders`|Returns
 non-parsed httpHeaders that can be used by the user.
-|=======================================================================
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 === Advanced Azure Storage Queue configuration
 If your Camel Application is running behind a firewall or if you need to
diff --git 
a/components/camel-azure/camel-azure-storage-queue/src/main/java/org/apache/camel/component/azure/storage/queue/QueueConstants.java
 
b/components/camel-azure/camel-azure-storage-queue/src/main/java/org/apache/camel/component/azure/storage/queue/QueueConstants.java
index 246a6d1..01ffc0a 100644
--- 
a/components/camel-azure/camel-azure-storage-queue/src/main/java/org/apache/camel/component/azure/storage/queue/QueueConstants.java
+++ 
b/components/camel-azure/camel-azure-storage-queue/src/main/java/org/apache/camel/component/azure/storage/queue/QueueConstants.java
@@ -16,25 +16,64 @@
  */
 package org.apache.camel.component.azure.storage.queue;
 
+import org.apache.camel.spi.Metadata;
+
 public final class QueueConstants {
     private static final String HEADER_PREFIX = "CamelAzureStorageQueue";
     // header names
+    @Metadata(description = "Returns non-parsed httpHeaders that can be used 
by the user.", javaType = "HttpHeaders")
     public static final String RAW_HTTP_HEADERS = HEADER_PREFIX + 
"RawHttpHeaders";
+    @Metadata(label = "producer", description = "(createQueue) Metadata to 
associate with the queue",
+              javaType = "Map<String,String>")
     public static final String METADATA = HEADER_PREFIX + "Metadata";
+    @Metadata(description = "The ID of the message.", javaType = "String")
     public static final String MESSAGE_ID = HEADER_PREFIX + "MessageId";
+    @Metadata(description = "The time the Message was inserted into the 
Queue.", javaType = "OffsetDateTime")
     public static final String INSERTION_TIME = HEADER_PREFIX + 
"InsertionTime";
+    @Metadata(description = "The time that the Message will expire and be 
automatically deleted.", javaType = "OffsetDateTime")
     public static final String EXPIRATION_TIME = HEADER_PREFIX + 
"ExpirationTime";
+    @Metadata(label = "producer",
+              description = "(deleteMessage, updateMessage) Unique identifier 
that must match for the message to be deleted or updated. "
+                            +
+                            "If deletion fails using this pop receipt then the 
message has been dequeued by another client.",
+              javaType = "String")
     public static final String POP_RECEIPT = HEADER_PREFIX + "PopReceipt";
+    @Metadata(description = "The time that the message will again become 
visible in the Queue.", javaType = "OffsetDateTime")
     public static final String TIME_NEXT_VISIBLE = HEADER_PREFIX + 
"TimeNextVisible";
+    @Metadata(description = "The number of times the message has been 
dequeued.", javaType = "long")
     public static final String DEQUEUE_COUNT = HEADER_PREFIX + "DequeueCount";
     // headers to be retrieved
+    @Metadata(label = "producer",
+              description = "(All) Specify the producer operation to execute, 
please see the doc on this page related to producer operation.",
+              javaType = 
"org.apache.camel.component.azure.storage.queue.QueueOperationDefinition")
     public static final String QUEUE_OPERATION = HEADER_PREFIX + "Operation";
+    @Metadata(label = "producer", description = "(All) Override the queue 
name.", javaType = "String")
     public static final String QUEUE_NAME = HEADER_PREFIX + "Name";
+    @Metadata(label = "producer", description = "(listQueues) Options for 
listing queues", javaType = "QueuesSegmentOptions")
     public static final String QUEUES_SEGMENT_OPTIONS = HEADER_PREFIX + 
"SegmentOptions";
+    @Metadata(label = "producer",
+              description = "(All) An optional timeout value beyond which a 
`RuntimeException` will be raised.",
+              javaType = "Duration")
     public static final String TIMEOUT = HEADER_PREFIX + "Timeout";
+    @Metadata(label = "producer",
+              description = "(receiveMessages, peekMessages) Maximum number of 
messages to get, if there are less messages exist in the queue than requested 
all the messages will be returned. "
+                            +
+                            "If left empty only 1 message will be retrieved, 
the allowed range is 1 to 32 messages.",
+              javaType = "Integer")
     public static final String MAX_MESSAGES = HEADER_PREFIX + "MaxMessages";
+    @Metadata(label = "producer",
+              description = "(sendMessage, receiveMessages, updateMessage) The 
timeout period for how long the message is invisible in the queue. "
+                            +
+                            "If unset the value will default to 0 and the 
message will be instantly visible. The timeout must be between 0 seconds and 7 
days.",
+              javaType = "Duration")
     public static final String VISIBILITY_TIMEOUT = HEADER_PREFIX + 
"VisibilityTimeout";
+    @Metadata(label = "producer", description = "(sendMessage) How long the 
message will stay alive in the queue. " +
+                                                "If unset the value will 
default to 7 days, if -1 is passed the message will not expire. The time to 
live must be -1 or any positive number.",
+              javaType = "Duration")
     public static final String TIME_TO_LIVE = HEADER_PREFIX + "TimeToLive";
+    @Metadata(label = "producer",
+              description = "(sendMessage) When is set to `true`, the queue 
will be automatically created when sending messages to the queue.",
+              javaType = "boolean")
     public static final String CREATE_QUEUE = HEADER_PREFIX + "CreateQueue";
 
     private QueueConstants() {
diff --git 
a/components/camel-azure/camel-azure-storage-queue/src/main/java/org/apache/camel/component/azure/storage/queue/QueueEndpoint.java
 
b/components/camel-azure/camel-azure-storage-queue/src/main/java/org/apache/camel/component/azure/storage/queue/QueueEndpoint.java
index a28c20c..f3cae26 100644
--- 
a/components/camel-azure/camel-azure-storage-queue/src/main/java/org/apache/camel/component/azure/storage/queue/QueueEndpoint.java
+++ 
b/components/camel-azure/camel-azure-storage-queue/src/main/java/org/apache/camel/component/azure/storage/queue/QueueEndpoint.java
@@ -32,7 +32,8 @@ import org.apache.camel.util.ObjectHelper;
  * Stores and retrieves messages to/from Azure Storage Queue.
  */
 @UriEndpoint(firstVersion = "3.3.0", scheme = "azure-storage-queue", title = 
"Azure Storage Queue Service",
-             syntax = "azure-storage-queue:accountName/queueName", category = 
{ Category.CLOUD, Category.MESSAGING })
+             syntax = "azure-storage-queue:accountName/queueName", category = 
{ Category.CLOUD, Category.MESSAGING },
+             headersClass = QueueConstants.class)
 public class QueueEndpoint extends ScheduledPollEndpoint {
 
     private QueueServiceClient queueServiceClient;

Reply via email to