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 6a1e114d6d8af0d0e08b7ef6dab7b41182645aab Author: Nicolas Filotto <[email protected]> AuthorDate: Tue Mar 22 12:42:05 2022 +0100 CAMEL-17792: Add doc about the message headers of camel-google-bigquery --- .../component/google/bigquery/google-bigquery.json | 6 ++++++ .../google/bigquery/sql/google-bigquery-sql.json | 4 ++++ .../src/main/docs/google-bigquery-component.adoc | 15 +++------------ .../src/main/docs/google-bigquery-sql-component.adoc | 20 +++----------------- .../google/bigquery/GoogleBigQueryConstants.java | 16 ++++++++++++++++ .../google/bigquery/GoogleBigQueryEndpoint.java | 6 ++++-- .../bigquery/sql/GoogleBigQuerySQLEndpoint.java | 8 ++++++-- 7 files changed, 42 insertions(+), 33 deletions(-) diff --git a/components/camel-google/camel-google-bigquery/src/generated/resources/org/apache/camel/component/google/bigquery/google-bigquery.json b/components/camel-google/camel-google-bigquery/src/generated/resources/org/apache/camel/component/google/bigquery/google-bigquery.json index 7330c02..d0871ea 100644 --- a/components/camel-google/camel-google-bigquery/src/generated/resources/org/apache/camel/component/google/bigquery/google-bigquery.json +++ b/components/camel-google/camel-google-bigquery/src/generated/resources/org/apache/camel/component/google/bigquery/google-bigquery.json @@ -28,6 +28,12 @@ "projectId": { "kind": "property", "displayName": "Project Id", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Google Cloud Project Id" }, "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 [...] }, + "headers": { + "CamelGoogleBigQueryTableSuffix": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Table suffix to use when inserting data" }, + "CamelGoogleBigQueryTableId": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Table id where data will be submitted. If specified will override endpoint configuration" }, + "CamelGoogleBigQueryInsertId": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "InsertId to use when inserting data" }, + "CamelGoogleBigQueryPartitionDecorator": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Partition decorator to indicate partition to use when inserting data" } + }, "properties": { "projectId": { "kind": "path", "displayName": "Project Id", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.bigquery.GoogleBigQueryConfiguration", "configurationField": "configuration", "description": "Google Cloud Project Id" }, "datasetId": { "kind": "path", "displayName": "Dataset Id", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.bigquery.GoogleBigQueryConfiguration", "configurationField": "configuration", "description": "BigQuery Dataset Id" }, diff --git a/components/camel-google/camel-google-bigquery/src/generated/resources/org/apache/camel/component/google/bigquery/sql/google-bigquery-sql.json b/components/camel-google/camel-google-bigquery/src/generated/resources/org/apache/camel/component/google/bigquery/sql/google-bigquery-sql.json index 8080d33..add1666 100644 --- a/components/camel-google/camel-google-bigquery/src/generated/resources/org/apache/camel/component/google/bigquery/sql/google-bigquery-sql.json +++ b/components/camel-google/camel-google-bigquery/src/generated/resources/org/apache/camel/component/google/bigquery/sql/google-bigquery-sql.json @@ -27,6 +27,10 @@ "projectId": { "kind": "property", "displayName": "Project Id", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Google Cloud Project Id" }, "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 [...] }, + "headers": { + "CamelGoogleBigQueryTranslatedQuery": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Preprocessed query text" }, + "CamelGoogleBigQueryJobId": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "com.google.cloud.bigquery.JobId", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A custom `JobId` to use" } + }, "properties": { "projectId": { "kind": "path", "displayName": "Project Id", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.bigquery.sql.GoogleBigQuerySQLConfiguration", "configurationField": "configuration", "description": "Google Cloud Project Id" }, "queryString": { "kind": "path", "displayName": "Query String", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.bigquery.sql.GoogleBigQuerySQLConfiguration", "configurationField": "configuration", "description": "BigQuery standard SQL query" }, diff --git a/components/camel-google/camel-google-bigquery/src/main/docs/google-bigquery-component.adoc b/components/camel-google/camel-google-bigquery/src/main/docs/google-bigquery-component.adoc index e4e2fb4..edb5100 100644 --- a/components/camel-google/camel-google-bigquery/src/main/docs/google-bigquery-component.adoc +++ b/components/camel-google/camel-google-bigquery/src/main/docs/google-bigquery-component.adoc @@ -69,18 +69,9 @@ include::partial$component-endpoint-options.adoc[] // endpoint options: END - -== Message Headers - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Name |Type |Description -|`CamelGoogleBigQueryTableSuffix` |`String` |Table suffix to use when inserting data -|`CamelGoogleBigQueryInsertId` |`String` |InsertId to use when inserting data -|`CamelGoogleBigQueryPartitionDecorator` |`String` |Partition decorator to indicate partition to use when inserting data -|`CamelGoogleBigQueryTableId` |`String` |Table id where data will be submitted. If specified will override endpoint configuration -|======================================================================= - +// component headers: START +include::partial$component-endpoint-headers.adoc[] +// component headers: END == Producer Endpoints diff --git a/components/camel-google/camel-google-bigquery/src/main/docs/google-bigquery-sql-component.adoc b/components/camel-google/camel-google-bigquery/src/main/docs/google-bigquery-sql-component.adoc index 861bc10..9ddd143 100644 --- a/components/camel-google/camel-google-bigquery/src/main/docs/google-bigquery-sql-component.adoc +++ b/components/camel-google/camel-google-bigquery/src/main/docs/google-bigquery-sql-component.adoc @@ -86,23 +86,9 @@ include::partial$component-endpoint-options.adoc[] // endpoint options: END - -== Message Headers - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Name |Type |Description -|`CamelGoogleBigQueryJobId` |`JobId` |A custom `JobId` to use -|======================================================================= - -== Output Message Headers - -[width="100%",cols="10%,10%,80%",options="header",] -|======================================================================= -|Name |Type |Description -|`CamelGoogleBigQueryTranslatedQuery` |`String` | Preprocessed query text -|======================================================================= - +// component headers: START +include::partial$component-endpoint-headers.adoc[] +// component headers: END == Producer Endpoints diff --git a/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryConstants.java b/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryConstants.java index dc33212..6acba6b 100644 --- a/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryConstants.java +++ b/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryConstants.java @@ -16,12 +16,28 @@ */ package org.apache.camel.component.google.bigquery; +import org.apache.camel.spi.Metadata; + public final class GoogleBigQueryConstants { + + // All the schemes + public static final String SCHEME_BIGQUERY_SQL = "google-bigquery-sql"; + public static final String SCHEME_BIGQUERY = "google-bigquery"; + + @Metadata(description = "Table suffix to use when inserting data", javaType = "String", applicableFor = SCHEME_BIGQUERY) public static final String TABLE_SUFFIX = "CamelGoogleBigQueryTableSuffix"; + @Metadata(description = "Table id where data will be submitted. If specified will override endpoint configuration", + javaType = "String", applicableFor = SCHEME_BIGQUERY) public static final String TABLE_ID = "CamelGoogleBigQueryTableId"; + @Metadata(description = "InsertId to use when inserting data", javaType = "String", applicableFor = SCHEME_BIGQUERY) public static final String INSERT_ID = "CamelGoogleBigQueryInsertId"; + @Metadata(description = "Partition decorator to indicate partition to use when inserting data", javaType = "String", + applicableFor = SCHEME_BIGQUERY) public static final String PARTITION_DECORATOR = "CamelGoogleBigQueryPartitionDecorator"; + @Metadata(description = "Preprocessed query text", javaType = "String", applicableFor = SCHEME_BIGQUERY_SQL) public static final String TRANSLATED_QUERY = "CamelGoogleBigQueryTranslatedQuery"; + @Metadata(description = "A custom `JobId` to use", javaType = "com.google.cloud.bigquery.JobId", + applicableFor = SCHEME_BIGQUERY_SQL) public static final String JOB_ID = "CamelGoogleBigQueryJobId"; /** diff --git a/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryEndpoint.java b/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryEndpoint.java index 6f527d9..e7033b3 100644 --- a/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryEndpoint.java +++ b/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/GoogleBigQueryEndpoint.java @@ -25,6 +25,8 @@ import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.DefaultEndpoint; +import static org.apache.camel.component.google.bigquery.GoogleBigQueryConstants.SCHEME_BIGQUERY; + /** * Google BigQuery data warehouse for analytics. * @@ -37,9 +39,9 @@ import org.apache.camel.support.DefaultEndpoint; * Another consideration is that exceptions are not handled within the class. They are expected to bubble up and be * handled by Camel. */ -@UriEndpoint(firstVersion = "2.20.0", scheme = "google-bigquery", title = "Google BigQuery", +@UriEndpoint(firstVersion = "2.20.0", scheme = SCHEME_BIGQUERY, title = "Google BigQuery", syntax = "google-bigquery:projectId:datasetId:tableId", - category = { Category.CLOUD, Category.BIGDATA }, producerOnly = true) + category = { Category.CLOUD, Category.BIGDATA }, producerOnly = true, headersClass = GoogleBigQueryConstants.class) public class GoogleBigQueryEndpoint extends DefaultEndpoint { @UriParam diff --git a/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/sql/GoogleBigQuerySQLEndpoint.java b/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/sql/GoogleBigQuerySQLEndpoint.java index 5549a3c..35da8fc 100644 --- a/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/sql/GoogleBigQuerySQLEndpoint.java +++ b/components/camel-google/camel-google-bigquery/src/main/java/org/apache/camel/component/google/bigquery/sql/GoogleBigQuerySQLEndpoint.java @@ -20,10 +20,13 @@ import com.google.cloud.bigquery.BigQuery; import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.component.google.bigquery.GoogleBigQueryConstants; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.DefaultEndpoint; +import static org.apache.camel.component.google.bigquery.GoogleBigQueryConstants.SCHEME_BIGQUERY_SQL; + /** * Access Google Cloud BigQuery service using SQL queries. * @@ -36,8 +39,9 @@ import org.apache.camel.support.DefaultEndpoint; * Another consideration is that exceptions are not handled within the class. They are expected to bubble up and be * handled by Camel. */ -@UriEndpoint(firstVersion = "2.23.0", scheme = "google-bigquery-sql", title = "Google BigQuery Standard SQL", - syntax = "google-bigquery-sql:projectId:queryString", label = "cloud,messaging", producerOnly = true) +@UriEndpoint(firstVersion = "2.23.0", scheme = SCHEME_BIGQUERY_SQL, title = "Google BigQuery Standard SQL", + syntax = "google-bigquery-sql:projectId:queryString", label = "cloud,messaging", producerOnly = true, + headersClass = GoogleBigQueryConstants.class) public class GoogleBigQuerySQLEndpoint extends DefaultEndpoint { @UriParam
