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/17 18:32:09 UTC
[camel] 02/13: CAMEL-17792: Add doc about the message headers of camel-beanstalk
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 043239134e576ffd0e0c796118acfd1bdabac6f7
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Thu Mar 17 11:21:30 2022 +0100
CAMEL-17792: Add doc about the message headers of camel-beanstalk
---
.../camel/component/beanstalk/beanstalk.json | 15 ++++++++++
.../src/main/docs/beanstalk-component.adoc | 32 ++--------------------
.../component/beanstalk/BeanstalkEndpoint.java | 2 +-
.../apache/camel/component/beanstalk/Headers.java | 17 ++++++++++++
4 files changed, 36 insertions(+), 30 deletions(-)
diff --git a/components/camel-beanstalk/src/generated/resources/org/apache/camel/component/beanstalk/beanstalk.json b/components/camel-beanstalk/src/generated/resources/org/apache/camel/component/beanstalk/beanstalk.json
index 9f6b861..1483f20 100644
--- a/components/camel-beanstalk/src/generated/resources/org/apache/camel/component/beanstalk/beanstalk.json
+++ b/components/camel-beanstalk/src/generated/resources/org/apache/camel/component/beanstalk/beanstalk.json
@@ -27,6 +27,21 @@
"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 [...]
"connectionSettingsFactory": { "kind": "property", "displayName": "Connection Settings Factory", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.beanstalk.ConnectionSettingsFactory", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Custom ConnectionSettingsFactory. Specify which ConnectionSettingsFactory to use to make connections to Beanstalkd. Especially useful for [...]
},
+ "headers": {
+ "beanstalk.priority": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The priority value set" },
+ "beanstalk.delay": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Job delay in seconds" },
+ "beanstalk.timeToRun": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Job time to run in seconds. (when 0, the beanstalkd daemon raises it to 1 automatically, see Beanstalk protocol)" },
+ "beanstalk.jobId": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Job ID" },
+ "beanstalk.result": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The flag indicating if the operation was a success or not" },
+ "beanstalk.tube": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the tube that contains this job" },
+ "beanstalk.state": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "\u201Cready\u201D or \u201Cdelayed\u201D or \u201Creserved\u201D or \u201Cburied\u201D (must be \u201Creserved\u201D)" },
+ "beanstalk.age": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The time in seconds since the put command that created this job" },
+ "beanstalk.time-left": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of seconds left until the server puts this job into the ready queue" },
+ "beanstalk.timeouts": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of times this job has timed out during a reservation" },
+ "beanstalk.releases": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of times a client has released this job from a reservation" },
+ "beanstalk.buries": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of times this job has been buried" },
+ "beanstalk.kicks": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The number of times this job has been kicked" }
+ },
"properties": {
"connectionSettings": { "kind": "path", "displayName": "Connection Settings", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Connection settings host:port\/tube" },
"command": { "kind": "parameter", "displayName": "Command", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.beanstalk.BeanstalkCommand", "enum": [ "bury", "release", "put", "touch", "delete", "kick" ], "deprecated": false, "autowired": false, "secret": false, "description": "put means to put the job into Beanstalk. Job body is specified in the Camel message body. Job ID will be returned in beanstalk.jobId message header. de [...]
diff --git a/components/camel-beanstalk/src/main/docs/beanstalk-component.adoc b/components/camel-beanstalk/src/main/docs/beanstalk-component.adoc
index ea878e6..523b99a 100644
--- a/components/camel-beanstalk/src/main/docs/beanstalk-component.adoc
+++ b/components/camel-beanstalk/src/main/docs/beanstalk-component.adoc
@@ -104,35 +104,9 @@ Consumer] which means there is more options you can configure, such as
how frequent the consumer should poll. For more details
see Polling Consumer.
-== Consumer Headers
-
-The consumer stores a number of job headers in the Exchange message:
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Property |Type |Description
-
-|_beanstalk.jobId_ |long | Job ID
-
-|_beanstalk.tube_ |string |the name of the tube that contains this job
-
-|_beanstalk.state_ |string |“ready” or “delayed” or “reserved” or “buried” (must be “reserved”)
-
-|_beanstalk.priority_ |long |the priority value set
-
-|_beanstalk.age_ |int |the time in seconds since the put command that created this job
-
-|_beanstalk.time-left_ |int |the number of seconds left until the server puts this job into the ready
-queue
-
-|_beanstalk.timeouts_ |int |the number of times this job has timed out during a reservation
-
-|_beanstalk.releases_ |int |the number of times a client has released this job from a reservation
-
-|_beanstalk.buries_ |int |the number of times this job has been buried
-
-|_beanstalk.kicks_ |int |the number of times this job has been kicked
-|=======================================================================
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
== Examples
diff --git a/components/camel-beanstalk/src/main/java/org/apache/camel/component/beanstalk/BeanstalkEndpoint.java b/components/camel-beanstalk/src/main/java/org/apache/camel/component/beanstalk/BeanstalkEndpoint.java
index 1e436d0..655d13f 100644
--- a/components/camel-beanstalk/src/main/java/org/apache/camel/component/beanstalk/BeanstalkEndpoint.java
+++ b/components/camel-beanstalk/src/main/java/org/apache/camel/component/beanstalk/BeanstalkEndpoint.java
@@ -39,7 +39,7 @@ import org.apache.camel.support.ScheduledPollEndpoint;
* Retrieve and post-process Beanstalk jobs.
*/
@UriEndpoint(firstVersion = "2.15.0", scheme = "beanstalk", title = "Beanstalk", syntax = "beanstalk:connectionSettings",
- category = { Category.MESSAGING })
+ category = { Category.MESSAGING }, headersClass = Headers.class)
public class BeanstalkEndpoint extends ScheduledPollEndpoint implements AsyncEndpoint {
final ConnectionSettings conn;
diff --git a/components/camel-beanstalk/src/main/java/org/apache/camel/component/beanstalk/Headers.java b/components/camel-beanstalk/src/main/java/org/apache/camel/component/beanstalk/Headers.java
index 4e7a305..87d4d55 100644
--- a/components/camel-beanstalk/src/main/java/org/apache/camel/component/beanstalk/Headers.java
+++ b/components/camel-beanstalk/src/main/java/org/apache/camel/component/beanstalk/Headers.java
@@ -16,29 +16,46 @@
*/
package org.apache.camel.component.beanstalk;
+import org.apache.camel.spi.Metadata;
+
public final class Headers {
public static final String PREFIX = "beanstalk.";
// in
+ @Metadata(description = "The priority value set", javaType = "long")
public static final String PRIORITY = PREFIX + "priority";
+ @Metadata(description = "The Job delay in seconds", javaType = "Integer")
public static final String DELAY = PREFIX + "delay";
+ @Metadata(description = "The Job time to run in seconds. (when 0, the beanstalkd daemon raises it to 1 automatically, see Beanstalk protocol)",
+ javaType = "Integer")
public static final String TIME_TO_RUN = PREFIX + "timeToRun";
// in/out
+ @Metadata(description = "Job ID", javaType = "long")
public static final String JOB_ID = PREFIX + "jobId";
// out
+ @Metadata(description = "The flag indicating if the operation was a success or not", javaType = "Boolean")
public static final String RESULT = PREFIX + "result";
// other info
+ @Metadata(description = "The name of the tube that contains this job", javaType = "String")
public static final String TUBE = PREFIX + "tube";
+ @Metadata(description = "“ready” or “delayed” or “reserved” or “buried” (must be “reserved”)", javaType = "String")
public static final String STATE = PREFIX + "state";
+ @Metadata(description = "The time in seconds since the put command that created this job", javaType = "Integer")
public static final String AGE = PREFIX + "age";
+ @Metadata(description = "The number of seconds left until the server puts this job into the ready queue",
+ javaType = "Integer")
public static final String TIME_LEFT = PREFIX + "time-left";
+ @Metadata(description = "The number of times this job has timed out during a reservation", javaType = "Integer")
public static final String TIMEOUTS = PREFIX + "timeouts";
+ @Metadata(description = "The number of times a client has released this job from a reservation", javaType = "Integer")
public static final String RELEASES = PREFIX + "releases";
+ @Metadata(description = "The number of times this job has been buried", javaType = "Integer")
public static final String BURIES = PREFIX + "buries";
+ @Metadata(description = "The number of times this job has been kicked", javaType = "Integer")
public static final String KICKS = PREFIX + "kicks";
private Headers() {