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/29 16:59:55 UTC

[camel] 12/12: CAMEL-17792: Add doc about the message headers of camel-ironmq

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 92ee368f6bab1d07f4c166358c2b04a24f8c0e0e
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Tue Mar 29 18:56:18 2022 +0200

    CAMEL-17792: Add doc about the message headers of camel-ironmq
---
 .../org/apache/camel/component/ironmq/ironmq.json  |  6 +++++
 .../src/main/docs/ironmq-component.adoc            | 26 ++++------------------
 .../camel/component/ironmq/IronMQConstants.java    | 11 +++++++++
 .../camel/component/ironmq/IronMQEndpoint.java     |  2 +-
 4 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/components/camel-ironmq/src/generated/resources/org/apache/camel/component/ironmq/ironmq.json b/components/camel-ironmq/src/generated/resources/org/apache/camel/component/ironmq/ironmq.json
index bf2e60b..9d4385b 100644
--- a/components/camel-ironmq/src/generated/resources/org/apache/camel/component/ironmq/ironmq.json
+++ b/components/camel-ironmq/src/generated/resources/org/apache/camel/component/ironmq/ironmq.json
@@ -26,6 +26,12 @@
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
     "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
   },
+  "headers": {
+    "CamelIronMQMessageId": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String or io.iron.ironmq.Ids", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "(producer) The id of the IronMQ message as a String when sending a single message, or a Ids object when sending a array of strings. (consumer) The id of the message." },
+    "CamelIronMQReservationId": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The reservation id of the message." },
+    "CamelIronMQReservedCount": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of times this message has been reserved." },
+    "CamelIronMQOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "If value set to 'CamelIronMQClearQueue' the queue is cleared of unconsumed  messages." }
+  },
   "properties": {
     "queueName": { "kind": "path", "displayName": "Queue Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ironmq.IronMQConfiguration", "configurationField": "configuration", "description": "The name of the IronMQ queue" },
     "client": { "kind": "parameter", "displayName": "Client", "group": "common", "label": "", "required": false, "type": "object", "javaType": "io.iron.ironmq.Client", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.ironmq.IronMQConfiguration", "configurationField": "configuration", "description": "Reference to a io.iron.ironmq.Client in the Registry." },
diff --git a/components/camel-ironmq/src/main/docs/ironmq-component.adoc b/components/camel-ironmq/src/main/docs/ironmq-component.adoc
index 5447d6b..bbf3b80 100644
--- a/components/camel-ironmq/src/main/docs/ironmq-component.adoc
+++ b/components/camel-ironmq/src/main/docs/ironmq-component.adoc
@@ -54,31 +54,13 @@ include::partial$component-endpoint-options.adoc[]
 // endpoint options: START
 
 // endpoint options: END
-
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Message Body
 
-Should be either a String or a array of Strings. In the latter case the batch of strings will be send to IronMQ as one request, creating one message pr. element in the array.
-
-== Producer message headers
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type | Description
-|CamelIronMQOperation |String|If value set to 'CamelIronMQClearQueue' the queue is cleared of unconsumed  messages.
-|CamelIronMQMessageId |String or io.iron.ironmq.Ids|The id of the IronMQ message as a String when sending a single message, or a Ids object when sending a array of strings.
-|=======================================================================
-
-== Consumer message headers
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type | Description
-|CamelIronMQMessageId    |String|The id of the message.
-|CamelIronMQReservationId|String|The reservation id of the message.
-|CamelIronMQReservedCount|String|The number of times this message has been reserved.
-|=======================================================================
-
+Should be either a String or a array of Strings. In the latter case the batch of strings will be sent to IronMQ as one request, creating one message pr. element in the array.
 
 == Consumer example
 
diff --git a/components/camel-ironmq/src/main/java/org/apache/camel/component/ironmq/IronMQConstants.java b/components/camel-ironmq/src/main/java/org/apache/camel/component/ironmq/IronMQConstants.java
index 5c60e6c..8baa1a2 100644
--- a/components/camel-ironmq/src/main/java/org/apache/camel/component/ironmq/IronMQConstants.java
+++ b/components/camel-ironmq/src/main/java/org/apache/camel/component/ironmq/IronMQConstants.java
@@ -16,11 +16,22 @@
  */
 package org.apache.camel.component.ironmq;
 
+import org.apache.camel.spi.Metadata;
+
 public interface IronMQConstants {
 
+    @Metadata(description = "(producer) The id of the IronMQ message as a String when sending a single message, or a Ids object when sending a array of strings."
+                            +
+                            " (consumer) The id of the message.",
+              javaType = "String or io.iron.ironmq.Ids")
     String MESSAGE_ID = "CamelIronMQMessageId";
+    @Metadata(label = "consumer", description = "The reservation id of the message.", javaType = "String")
     String MESSAGE_RESERVATION_ID = "CamelIronMQReservationId";
+    @Metadata(label = "consumer", description = "The number of times this message has been reserved.", javaType = "long")
     String MESSAGE_RESERVED_COUNT = "CamelIronMQReservedCount";
+    @Metadata(label = "producer",
+              description = "If value set to 'CamelIronMQClearQueue' the queue is cleared of unconsumed  messages.",
+              javaType = "String")
     String OPERATION = "CamelIronMQOperation";
     String CLEARQUEUE = "CamelIronMQClearQueue";
 
diff --git a/components/camel-ironmq/src/main/java/org/apache/camel/component/ironmq/IronMQEndpoint.java b/components/camel-ironmq/src/main/java/org/apache/camel/component/ironmq/IronMQEndpoint.java
index 96a140c2..af4367b 100644
--- a/components/camel-ironmq/src/main/java/org/apache/camel/component/ironmq/IronMQEndpoint.java
+++ b/components/camel-ironmq/src/main/java/org/apache/camel/component/ironmq/IronMQEndpoint.java
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
  * queue as a service.
  */
 @UriEndpoint(firstVersion = "2.17.0", scheme = "ironmq", syntax = "ironmq:queueName", title = "IronMQ",
-             category = { Category.CLOUD, Category.MESSAGING })
+             category = { Category.CLOUD, Category.MESSAGING }, headersClass = IronMQConstants.class)
 public class IronMQEndpoint extends ScheduledPollEndpoint {
 
     private static final Logger LOG = LoggerFactory.getLogger(IronMQEndpoint.class);