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/04/06 15:22:55 UTC
[camel] 18/20: CAMEL-17792: Add doc about the message headers of camel-zookeeper
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 e06fe04652e523b17541c3067b223752fefa07cf
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Wed Apr 6 16:45:21 2022 +0200
CAMEL-17792: Add doc about the message headers of camel-zookeeper
---
.../org/apache/camel/component/zookeeper/zookeeper.json | 9 +++++++++
.../camel-zookeeper/src/main/docs/zookeeper-component.adoc | 4 +++-
.../camel/component/zookeeper/ZooKeeperEndpoint.java | 2 +-
.../apache/camel/component/zookeeper/ZooKeeperMessage.java | 14 ++++++++------
4 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/components/camel-zookeeper/src/generated/resources/org/apache/camel/component/zookeeper/zookeeper.json b/components/camel-zookeeper/src/generated/resources/org/apache/camel/component/zookeeper/zookeeper.json
index 152df552d80..3bbad81d80d 100644
--- a/components/camel-zookeeper/src/generated/resources/org/apache/camel/component/zookeeper/zookeeper.json
+++ b/components/camel-zookeeper/src/generated/resources/org/apache/camel/component/zookeeper/zookeeper.json
@@ -34,6 +34,15 @@
"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 [...]
"configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.zookeeper.ZooKeeperConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "To use a shared ZooKeeperConfiguration" }
},
+ "headers": {
+ "CamelZooKeeperNode": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The node" },
+ "CamelZooKeeperVersion": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "-1", "description": "The node version" },
+ "CamelZookeeperAcl": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "List<ACL>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "Ids.OPEN_ACL_UNSAFE", "description": "The ACL" },
+ "CamelZookeeperCreateMode": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "org.apache.zookeeper.CreateMode or String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The create mode" },
+ "CamelZookeeperStatistics": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "org.apache.zookeeper.data.Stat", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The statistics" },
+ "CamelZookeeperEventType": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "org.apache.zookeeper.Watcher.Event.EventType", "enum": [ "None", "NodeCreated", "NodeDeleted", "NodeDataChanged", "NodeChildrenChanged", "DataWatchRemoved", "ChildWatchRemoved" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The event type" },
+ "CamelZookeeperOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform" }
+ },
"properties": {
"serverUrls": { "kind": "path", "displayName": "Server Urls", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.zookeeper.ZooKeeperConfiguration", "configurationField": "configuration", "description": "The zookeeper server hosts (multiple servers can be separated by comma)" },
"path": { "kind": "path", "displayName": "Path", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.zookeeper.ZooKeeperConfiguration", "configurationField": "configuration", "description": "The node in the ZooKeeper server (aka znode)" },
diff --git a/components/camel-zookeeper/src/main/docs/zookeeper-component.adoc b/components/camel-zookeeper/src/main/docs/zookeeper-component.adoc
index b82d6c330b8..6bbc479e989 100644
--- a/components/camel-zookeeper/src/main/docs/zookeeper-component.adoc
+++ b/components/camel-zookeeper/src/main/docs/zookeeper-component.adoc
@@ -60,7 +60,9 @@ include::partial$component-endpoint-options.adoc[]
// endpoint options: END
-
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
== Use cases
diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java
index 03d13fdeee8..cd34caeb36d 100644
--- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java
+++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java
@@ -34,7 +34,7 @@ import org.apache.camel.support.DefaultEndpoint;
*/
@ManagedResource(description = "ZooKeeper Endpoint")
@UriEndpoint(firstVersion = "2.9.0", scheme = "zookeeper", title = "ZooKeeper", syntax = "zookeeper:serverUrls/path",
- category = { Category.CLUSTERING, Category.MANAGEMENT, Category.BIGDATA })
+ category = { Category.CLUSTERING, Category.MANAGEMENT, Category.BIGDATA }, headersClass = ZooKeeperMessage.class)
public class ZooKeeperEndpoint extends DefaultEndpoint {
@UriParam
private ZooKeeperConfiguration configuration;
diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperMessage.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperMessage.java
index b443a7841a2..3c9e89dc854 100644
--- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperMessage.java
+++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperMessage.java
@@ -21,6 +21,7 @@ import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.Message;
+import org.apache.camel.spi.Metadata;
import org.apache.camel.support.DefaultMessage;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.data.Stat;
@@ -32,20 +33,21 @@ import org.apache.zookeeper.data.Stat;
*/
public class ZooKeeperMessage extends DefaultMessage {
+ @Metadata(description = "The node", javaType = "String")
public static final String ZOOKEEPER_NODE = "CamelZooKeeperNode";
-
+ @Metadata(description = "The node version", javaType = "Integer", defaultValue = "-1")
public static final String ZOOKEEPER_NODE_VERSION = "CamelZooKeeperVersion";
public static final String ZOOKEEPER_ERROR_CODE = "CamelZooKeeperErrorCode";
-
+ @Metadata(description = "The ACL", javaType = "List<ACL>", defaultValue = "Ids.OPEN_ACL_UNSAFE")
public static final String ZOOKEEPER_ACL = "CamelZookeeperAcl";
-
+ @Metadata(description = "The create mode", javaType = "org.apache.zookeeper.CreateMode or String")
public static final String ZOOKEEPER_CREATE_MODE = "CamelZookeeperCreateMode";
-
+ @Metadata(description = "The statistics", javaType = "org.apache.zookeeper.data.Stat")
public static final String ZOOKEEPER_STATISTICS = "CamelZookeeperStatistics";
-
+ @Metadata(description = "The event type", javaType = "org.apache.zookeeper.Watcher.Event.EventType")
public static final String ZOOKEEPER_EVENT_TYPE = "CamelZookeeperEventType";
-
+ @Metadata(label = "producer", description = "The operation to perform", javaType = "String")
public static final String ZOOKEEPER_OPERATION = "CamelZookeeperOperation";
public ZooKeeperMessage(CamelContext camelContext) {