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 7ce24d40298240b0ac52dcc2009107e0ded78466
Author: Nicolas Filotto <[email protected]>
AuthorDate: Fri Apr 1 12:25:00 2022 +0200

    CAMEL-17792: Add doc about the message headers of camel-nats
---
 .../resources/org/apache/camel/component/nats/nats.json  |  7 +++++++
 components/camel-nats/src/main/docs/nats-component.adoc  | 16 +++-------------
 .../org/apache/camel/component/nats/NatsConstants.java   |  7 +++++++
 .../org/apache/camel/component/nats/NatsEndpoint.java    |  3 ++-
 4 files changed, 19 insertions(+), 14 deletions(-)

diff --git 
a/components/camel-nats/src/generated/resources/org/apache/camel/component/nats/nats.json
 
b/components/camel-nats/src/generated/resources/org/apache/camel/component/nats/nats.json
index 75f2419..ab5f373 100644
--- 
a/components/camel-nats/src/generated/resources/org/apache/camel/component/nats/nats.json
+++ 
b/components/camel-nats/src/generated/resources/org/apache/camel/component/nats/nats.json
@@ -30,6 +30,13 @@
     "headerFilterStrategy": { "kind": "property", "displayName": "Header 
Filter Strategy", "group": "filter", "label": "filter", "required": false, 
"type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", 
"deprecated": false, "autowired": false, "secret": false, "description": "To 
use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and 
from Camel message." },
     "useGlobalSslContextParameters": { "kind": "property", "displayName": "Use 
Global Ssl Context Parameters", "group": "security", "label": "security", 
"required": false, "type": "boolean", "javaType": "boolean", "deprecated": 
false, "autowired": false, "secret": false, "defaultValue": false, 
"description": "Enable usage of global SSL context parameters." }
   },
+  "headers": {
+    "CamelNatsMessageTimestamp": { "kind": "header", "displayName": "", 
"group": "common", "label": "", "required": false, "javaType": "long", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The timestamp of a consumed message." },
+    "CamelNatsSID": { "kind": "header", "displayName": "", "group": "common", 
"label": "", "required": false, "javaType": "String", "deprecated": false, 
"deprecationNote": "", "autowired": false, "secret": false, "description": "The 
SID of a consumed message." },
+    "CamelNatsReplyTo": { "kind": "header", "displayName": "", "group": 
"common", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The ReplyTo of a consumed message (may be null)." },
+    "CamelNatsSubject": { "kind": "header", "displayName": "", "group": 
"common", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The Subject of a consumed message." },
+    "CamelNatsQueueName": { "kind": "header", "displayName": "", "group": 
"common", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The Queue name of a consumed message (may be null)." }
+  },
   "properties": {
     "topic": { "kind": "path", "displayName": "Topic", "group": "common", 
"label": "", "required": true, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "configurationClass": 
"org.apache.camel.component.nats.NatsConfiguration", "configurationField": 
"configuration", "description": "The name of topic we want to use" },
     "connectionTimeout": { "kind": "parameter", "displayName": "Connection 
Timeout", "group": "common", "label": "common", "required": false, "type": 
"integer", "javaType": "int", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": 2000, "configurationClass": 
"org.apache.camel.component.nats.NatsConfiguration", "configurationField": 
"configuration", "description": "Timeout for connection attempts. (in 
milliseconds)" },
diff --git a/components/camel-nats/src/main/docs/nats-component.adoc 
b/components/camel-nats/src/main/docs/nats-component.adoc
index 346e3a5..79e4bd2 100644
--- a/components/camel-nats/src/main/docs/nats-component.adoc
+++ b/components/camel-nats/src/main/docs/nats-component.adoc
@@ -48,7 +48,9 @@ include::partial$component-endpoint-options.adoc[]
 // endpoint options: START
 
 // endpoint options: END
-
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Configuring servers
 
@@ -90,18 +92,6 @@ If you are using Camel Main or Spring Boot you can configure 
the server urls in
 
camel.component.nats.servers=scott:tiger@someserver:4222,superman:123@someotherserver:42222
 ----
 
-== Headers
-
-[width="100%",options="header"]
-|=======================================================================
-|Name |Type |Description
-| CamelNatsSID | String | The SID of a consumed message.
-| CamelNatsReplyTo | String | The ReplyTo of a consumed message (may be null).
-| CamelNatsSubject | String | The Subject of a consumed message.
-| CamelNatsQueueName | String | The Queue name of a consumed message (may be 
null).
-| CamelNatsMessageTimestamp | long | The timestamp of a consumed message.
-|=======================================================================
-
 == Request/Reply support
 The producer supports request/reply where it can wait for an expected reply 
message.
 
diff --git 
a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConstants.java
 
b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConstants.java
index 14511b0..5c0b98a 100644
--- 
a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConstants.java
+++ 
b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsConstants.java
@@ -16,12 +16,19 @@
  */
 package org.apache.camel.component.nats;
 
+import org.apache.camel.spi.Metadata;
+
 public interface NatsConstants {
 
+    @Metadata(description = "The timestamp of a consumed message.", javaType = 
"long")
     String NATS_MESSAGE_TIMESTAMP = "CamelNatsMessageTimestamp";
+    @Metadata(description = "The SID of a consumed message.", javaType = 
"String")
     String NATS_SID = "CamelNatsSID";
+    @Metadata(description = "The ReplyTo of a consumed message (may be 
null).", javaType = "String")
     String NATS_REPLY_TO = "CamelNatsReplyTo";
+    @Metadata(description = "The Subject of a consumed message.", javaType = 
"String")
     String NATS_SUBJECT = "CamelNatsSubject";
+    @Metadata(description = "The Queue name of a consumed message (may be 
null).", javaType = "String")
     String NATS_QUEUE_NAME = "CamelNatsQueueName";
     String NATS_REQUEST_TIMEOUT_THREAD_PROFILE_NAME = 
"CamelNatsRequestTimeoutExecutor";
 }
diff --git 
a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsEndpoint.java
 
b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsEndpoint.java
index b0e589f..7cc24f5 100644
--- 
a/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsEndpoint.java
+++ 
b/components/camel-nats/src/main/java/org/apache/camel/component/nats/NatsEndpoint.java
@@ -40,7 +40,8 @@ import org.apache.camel.support.DefaultEndpoint;
 /**
  * Send and receive messages from <a href="http://nats.io/";>NATS</a> messaging 
system.
  */
-@UriEndpoint(firstVersion = "2.17.0", scheme = "nats", title = "Nats", syntax 
= "nats:topic", category = { Category.MESSAGING })
+@UriEndpoint(firstVersion = "2.17.0", scheme = "nats", title = "Nats", syntax 
= "nats:topic", category = { Category.MESSAGING },
+             headersClass = NatsConstants.class)
 public class NatsEndpoint extends DefaultEndpoint implements 
MultipleConsumersSupport, HeaderFilterStrategyAware {
 
     @UriParam

Reply via email to