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 95936c86603b32ffae3b43882e08c2135503ba07
Author: Nicolas Filotto <[email protected]>
AuthorDate: Wed Mar 30 18:34:07 2022 +0200

    CAMEL-17792: Add doc about the message headers of camel-jt400
---
 .../org/apache/camel/component/jt400/jt400.json    | 11 ++++++
 .../camel-jt400/src/main/docs/jt400-component.adoc | 40 ++------------------
 .../camel/component/jt400/Jt400Constants.java      | 43 +++++++++++++++++-----
 .../camel/component/jt400/Jt400Endpoint.java       |  3 +-
 4 files changed, 51 insertions(+), 46 deletions(-)

diff --git 
a/components/camel-jt400/src/generated/resources/org/apache/camel/component/jt400/jt400.json
 
b/components/camel-jt400/src/generated/resources/org/apache/camel/component/jt400/jt400.json
index b3186dc..ce1d056 100644
--- 
a/components/camel-jt400/src/generated/resources/org/apache/camel/component/jt400/jt400.json
+++ 
b/components/camel-jt400/src/generated/resources/org/apache/camel/component/jt400/jt400.json
@@ -27,6 +27,17 @@
     "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 [...]
     "connectionPool": { "kind": "property", "displayName": "Connection Pool", 
"group": "advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": "com.ibm.as400.access.AS400ConnectionPool", "deprecated": false, 
"autowired": false, "secret": false, "description": "Default connection pool 
used by the component. Note that this pool is lazily initialized. This is 
because in a scenario where the user always provides a pool, it would be 
wasteful for Camel to initialize a [...]
   },
+  "headers": {
+    "SENDER_INFORMATION": { "kind": "header", "displayName": "", "group": 
"consumer", "label": "consumer", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "*Data queues:* Returns the sender information for this 
data queue entry, or an empty string if not available.*Message queues: The job 
identifier of the sending job" },
+    "KEY": { "kind": "header", "displayName": "", "group": "common", "label": 
"", "required": false, "javaType": "String or byte[]", "deprecated": false, 
"deprecationNote": "", "autowired": false, "secret": false, "description": "The 
data queue key." },
+    "CamelJt400Message": { "kind": "header", "displayName": "", "group": 
"consumer", "label": "consumer", "required": false, "javaType": 
"com.ibm.as400.access.QueuedMessage", "deprecated": false, "deprecationNote": 
"", "autowired": false, "secret": false, "description": "The message received" 
},
+    "CamelJt400MessageID": { "kind": "header", "displayName": "", "group": 
"consumer", "label": "consumer", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The message identifier" },
+    "CamelJt400MessageFile": { "kind": "header", "displayName": "", "group": 
"consumer", "label": "consumer", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The message file name" },
+    "CamelJt400MessageType": { "kind": "header", "displayName": "", "group": 
"consumer", "label": "consumer", "required": false, "javaType": "Integer", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The message type (corresponds to constants defined in 
the AS400Message class)" },
+    "CamelJt400MessageSeverity": { "kind": "header", "displayName": "", 
"group": "consumer", "label": "consumer", "required": false, "javaType": 
"Integer", "deprecated": false, "deprecationNote": "", "autowired": false, 
"secret": false, "description": "The message severity (Valid values are between 
0 and 99, or -1 if it is not set)" },
+    "CamelJt400MessageDefaultReply": { "kind": "header", "displayName": "", 
"group": "consumer", "label": "consumer", "required": false, "javaType": 
"String", "deprecated": false, "deprecationNote": "", "autowired": false, 
"secret": false, "description": "The default message reply, when the message is 
an inquiry message" },
+    "CamelJt400MessageReplyToKey": { "kind": "header", "displayName": "", 
"group": "common", "label": "", "required": false, "javaType": "byte[]", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "*Consumer:* The key of the message that will be replied 
to (if the `sendingReply` parameter is set to `true`). *Producer:* If set, and 
if the message body is not empty, a new message will not be sent to the 
provided message queue. Instead, a respon [...]
+  },
   "properties": {
     "userID": { "kind": "path", "displayName": "User ID", "group": "security", 
"label": "security", "required": true, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": true, "configurationClass": 
"org.apache.camel.component.jt400.Jt400Configuration", "configurationField": 
"configuration", "description": "Returns the ID of the IBM i user." },
     "password": { "kind": "path", "displayName": "Password", "group": 
"security", "label": "security", "required": true, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", 
"autowired": false, "secret": true, "configurationClass": 
"org.apache.camel.component.jt400.Jt400Configuration", "configurationField": 
"configuration", "description": "Returns the password of the IBM i user." },
diff --git a/components/camel-jt400/src/main/docs/jt400-component.adoc 
b/components/camel-jt400/src/main/docs/jt400-component.adoc
index b325f3f..b78b24d 100644
--- a/components/camel-jt400/src/main/docs/jt400-component.adoc
+++ b/components/camel-jt400/src/main/docs/jt400-component.adoc
@@ -90,7 +90,7 @@ Inquiry messages or messages requiring a message ID are not 
supported.
 
 == Connection pool
 
-You can explicit configure a connection pool on the Jt400Component, or as an 
uri option
+You can explicitly configure a connection pool on the Jt400Component, or as an 
uri option
 on the endpoint.
 
 == Program call
@@ -107,41 +107,9 @@ objects representing the values as they were returned by 
the program. Input
 only parameters will contain the same data as the beginning of the invocation.
 This endpoint does not implement a provider endpoint!
 
-== Message headers
-
-=== Consumer headers when consuming from data queues
-
-The following headers are potentially available. If the values could not
-be determined, the headers will not be set
-[width="100%",cols="2m,2m,1m,5",options="header"]
-|===
-| Header constant                          | Header value                      
| Type    | Description
-| Jt400Endpoint.SENDER_INFORMATION         | "SENDER_INFORMATION"              
| String  | Returns the sender information for this data queue entry, or an 
empty string if not available
-|===
-
-=== Consumer headers when consuming from message queues
-
-The following headers are potentially available. If the values could not
-be determined, the headers will not be set
-[width="100%",cols="2m,2m,1m,5",options="header"]
-|===
-| Header constant                          | Header value                      
| Type           | Description
-| Jt400Constants.MESSAGE                   | "CamelJt400Message"               
| QueuedMessage  | The message received
-| Jt400Constants.MESSAGE_ID                | "CamelJt400MessageID"             
| String         | The message identifier
-| Jt400Constants.MESSAGE_FILE              | "CamelJt400MessageFile"           
| String         | The message file name
-| Jt400Constants.MESSAGE_TYPE              | "CamelJt400MessageType"           
| Integer        | The message type (corresponds to constants defined in the 
AS400Message class)
-| Jt400Constants.MESSAGE_SEVERITY          | "CamelJt400MessageSeverity"       
| Integer        | The message severity (Valid values are between 0 and 99, or 
-1 if it is not set)
-| Jt400Constants.MESSAGE_DFT_RPY           | "CamelJt400MessageDefaultReply"   
| String         | The default message reply, when the message is an inquiry 
message
-| Jt400Constants.MESSAGE_REPLYTO_KEY       | "CamelJt400MessageReplyToKey"     
| byte[]         | The key of the message that will be replied to (if the 
`sendingReply` parameter is set to `true`)
-| Jt400Constants.SENDER_INFORMATION        | "SENDER_INFORMATION"              
| String         | The job identifier of the sending job
-|===
-
-=== Producer headers when sending to message queues
-
-[width="100%",cols="2m,2m,1m,5",options="header"]
-|===
-| Jt400Constants.MESSAGE_REPLYTO_KEY        | "CamelJt400MessageReplyToKey"    
 | byte[]  | If set, and if the message body is not empty, a new message will 
not be sent to the provided message queue. Instead, a response will be sent to 
the message identified by the given key. This is set automatically when reading 
from the message queue if the `sendingReply` parameter is set to `true`.
-|===
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Example
 
diff --git 
a/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Constants.java
 
b/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Constants.java
index 73312f2..475945e 100755
--- 
a/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Constants.java
+++ 
b/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Constants.java
@@ -16,21 +16,46 @@
  */
 package org.apache.camel.component.jt400;
 
+import org.apache.camel.spi.Metadata;
+
 public interface Jt400Constants {
 
     //header names
-    public static final String SENDER_INFORMATION = "SENDER_INFORMATION";
+    @Metadata(label = "consumer",
+              description = "*Data queues:* Returns the sender information for 
this data queue entry, or an empty string if not available."
+                            +
+                            "*Message queues: The job identifier of the 
sending job",
+              javaType = "String")
+    String SENDER_INFORMATION = "SENDER_INFORMATION";
 
     // Used only for keyed data queue support
-    public static final String KEY = "KEY";
+    @Metadata(description = "The data queue key.", javaType = "String or 
byte[]")
+    String KEY = "KEY";
 
     // Used only for message queue support
-    public static final String MESSAGE = "CamelJt400Message";
-    public static final String MESSAGE_ID = "CamelJt400MessageID";
-    public static final String MESSAGE_FILE = "CamelJt400MessageFile";
-    public static final String MESSAGE_TYPE = "CamelJt400MessageType";
-    public static final String MESSAGE_SEVERITY = "CamelJt400MessageSeverity";
-    public static final String MESSAGE_DFT_RPY = 
"CamelJt400MessageDefaultReply";
-    public static final String MESSAGE_REPLYTO_KEY = 
"CamelJt400MessageReplyToKey";
+    @Metadata(label = "consumer", description = "The message received", 
javaType = "com.ibm.as400.access.QueuedMessage")
+    String MESSAGE = "CamelJt400Message";
+    @Metadata(label = "consumer", description = "The message identifier", 
javaType = "String")
+    String MESSAGE_ID = "CamelJt400MessageID";
+    @Metadata(label = "consumer", description = "The message file name", 
javaType = "String")
+    String MESSAGE_FILE = "CamelJt400MessageFile";
+    @Metadata(label = "consumer", description = "The message type (corresponds 
to constants defined in the AS400Message class)",
+              javaType = "Integer")
+    String MESSAGE_TYPE = "CamelJt400MessageType";
+    @Metadata(label = "consumer",
+              description = "The message severity (Valid values are between 0 
and 99, or -1 if it is not set)",
+              javaType = "Integer")
+    String MESSAGE_SEVERITY = "CamelJt400MessageSeverity";
+    @Metadata(label = "consumer", description = "The default message reply, 
when the message is an inquiry message",
+              javaType = "String")
+    String MESSAGE_DFT_RPY = "CamelJt400MessageDefaultReply";
+    @Metadata(description = "*Consumer:* The key of the message that will be 
replied to (if the `sendingReply` parameter is set to `true`). "
+                            +
+                            "*Producer:* If set, and if the message body is 
not empty, a new message will not be sent to the provided message queue. "
+                            +
+                            "Instead, a response will be sent to the message 
identified by the given key. " +
+                            "This is set automatically when reading from the 
message queue if the `sendingReply` parameter is set to `true`.",
+              javaType = "byte[]")
+    String MESSAGE_REPLYTO_KEY = "CamelJt400MessageReplyToKey";
 
 }
diff --git 
a/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java
 
b/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java
index de7d66c..c8f2fbd 100644
--- 
a/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java
+++ 
b/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java
@@ -40,7 +40,8 @@ import org.apache.camel.util.URISupport;
  * for AS/400 and iSeries servers.
  */
 @UriEndpoint(firstVersion = "1.5.0", scheme = "jt400", title = "JT400",
-             syntax = "jt400:userID:password/systemName/objectPath.type", 
category = { Category.MESSAGING })
+             syntax = "jt400:userID:password/systemName/objectPath.type", 
category = { Category.MESSAGING },
+             headersClass = Jt400Constants.class)
 public class Jt400Endpoint extends ScheduledPollEndpoint implements 
MultipleConsumersSupport {
 
     public static final String KEY = Jt400Constants.KEY;

Reply via email to