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/16 19:12:57 UTC

[camel] 08/33: CAMEL-17792: Add doc about the message headers of camel-avro-rpc-component

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 b7e3c50ab6e451f1a93569e1b22b4ab5edb8ab5d
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Tue Mar 15 18:11:41 2022 +0100

    CAMEL-17792: Add doc about the message headers of camel-avro-rpc-component
---
 .../resources/org/apache/camel/component/avro/avro.json |  3 +++
 .../src/main/docs/avro-component.adoc                   | 17 +++++------------
 .../org/apache/camel/component/avro/AvroConstants.java  |  4 ++++
 .../org/apache/camel/component/avro/AvroEndpoint.java   |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/components/camel-avro-rpc/camel-avro-rpc-component/src/generated/resources/org/apache/camel/component/avro/avro.json b/components/camel-avro-rpc/camel-avro-rpc-component/src/generated/resources/org/apache/camel/component/avro/avro.json
index dd09d1b..69c0c2f 100644
--- a/components/camel-avro-rpc/camel-avro-rpc-component/src/generated/resources/org/apache/camel/component/avro/avro.json
+++ b/components/camel-avro-rpc/camel-avro-rpc-component/src/generated/resources/org/apache/camel/component/avro/avro.json
@@ -33,6 +33,9 @@
     "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.avro.AvroConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "To use a shared AvroConfiguration to configure options once" }
   },
+  "headers": {
+    "CamelAvroMessageName": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the message to send. In consumer overrides message name from URI (if any)" }
+  },
   "properties": {
     "transport": { "kind": "path", "displayName": "Transport", "group": "common", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.avro.AvroTransport", "enum": [ "http", "netty" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.avro.AvroConfiguration", "configurationField": "configuration", "description": "Transport to use, can be either http or netty" },
     "port": { "kind": "path", "displayName": "Port", "group": "common", "label": "", "required": true, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.avro.AvroConfiguration", "configurationField": "configuration", "description": "Port number to use" },
diff --git a/components/camel-avro-rpc/camel-avro-rpc-component/src/main/docs/avro-component.adoc b/components/camel-avro-rpc/camel-avro-rpc-component/src/main/docs/avro-component.adoc
index 9f6a299..9964189 100644
--- a/components/camel-avro-rpc/camel-avro-rpc-component/src/main/docs/avro-component.adoc
+++ b/components/camel-avro-rpc/camel-avro-rpc-component/src/main/docs/avro-component.adoc
@@ -140,23 +140,16 @@ The response will be added in the body of the "out" message.
 In a similar manner when using camel avro consumers for avro ipc, the
 requests parameters will be placed inside the "in" message body of the
 created exchange and once the exchange is processed the body of the
-"out" message will be send as a response.
+"out" message will be sent as a response.
 
 *Note:* By default consumer parameters are wrapped into array. If you've
 got only one parameter, *since 2.12* you can use `singleParameter` URI
-option to receive it direcly in the "in" message body without array
+option to receive it directly in the "in" message body without array
 wrapping.
 
-
-== Avro RPC Headers
-
-[width="100%",cols="20%,80%",options="header",]
-|=======================================================================
-|Name |Description
-
-|`CamelAvroMessageName` |The name of the message to send. In consumer overrides message name from
-URI (if any)
-|=======================================================================
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Examples
 
diff --git a/components/camel-avro-rpc/camel-avro-rpc-component/src/main/java/org/apache/camel/component/avro/AvroConstants.java b/components/camel-avro-rpc/camel-avro-rpc-component/src/main/java/org/apache/camel/component/avro/AvroConstants.java
index 7a2b31d..c16282a 100644
--- a/components/camel-avro-rpc/camel-avro-rpc-component/src/main/java/org/apache/camel/component/avro/AvroConstants.java
+++ b/components/camel-avro-rpc/camel-avro-rpc-component/src/main/java/org/apache/camel/component/avro/AvroConstants.java
@@ -16,12 +16,16 @@
  */
 package org.apache.camel.component.avro;
 
+import org.apache.camel.spi.Metadata;
+
 public final class AvroConstants {
 
     public static final String AVRO_NETTY_TRANSPORT = "netty";
     public static final String AVRO_HTTP_TRANSPORT = "http";
     public static final String AVRO_MESSAGE_NAME_SEPARATOR = "/";
 
+    @Metadata(description = "The name of the message to send. In consumer overrides message name from URI (if any)",
+              javaType = "String")
     public static final String AVRO_MESSAGE_NAME = "CamelAvroMessageName";
 
     private AvroConstants() {
diff --git a/components/camel-avro-rpc/camel-avro-rpc-component/src/main/java/org/apache/camel/component/avro/AvroEndpoint.java b/components/camel-avro-rpc/camel-avro-rpc-component/src/main/java/org/apache/camel/component/avro/AvroEndpoint.java
index b5d555c..944099f 100644
--- a/components/camel-avro-rpc/camel-avro-rpc-component/src/main/java/org/apache/camel/component/avro/AvroEndpoint.java
+++ b/components/camel-avro-rpc/camel-avro-rpc-component/src/main/java/org/apache/camel/component/avro/AvroEndpoint.java
@@ -35,7 +35,7 @@ import org.apache.camel.support.DefaultEndpoint;
  * Produce or consume Apache Avro RPC services.
  */
 @UriEndpoint(firstVersion = "2.10.0", scheme = "avro", title = "Avro RPC", syntax = "avro:transport:host:port/messageName",
-             category = { Category.RPC })
+             category = { Category.RPC }, headersClass = AvroConstants.class)
 public abstract class AvroEndpoint extends DefaultEndpoint implements AsyncEndpoint {
 
     @UriParam