This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 264a61ec8064b3cf8aad01846c886b28a56e3a25
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Sun Sep 20 11:55:39 2020 +0200

    CAMEL-15549: Api consumer to expose splitResults options and some more work 
needed
---
 .../catalog/docs/google-sheets-component.adoc      | 25 +++++++++++++---
 .../docs/google-sheets-stream-component.adoc       | 15 ++++++++++
 .../camel/component/as2/AS2Configuration.java      |  3 +-
 .../apache/camel/component/as2/AS2Consumer.java    | 31 +++++++++----------
 .../apache/camel/component/as2/AS2Endpoint.java    |  1 -
 .../sheets/GoogleSheetsComponentConfigurer.java    |  5 ++++
 .../GoogleSheetsConfigurationConfigurer.java       |  5 ++++
 .../sheets/GoogleSheetsEndpointConfigurer.java     |  5 ++++
 ...preadsheetsEndpointConfigurationConfigurer.java |  5 ++++
 ...heetsValuesEndpointConfigurationConfigurer.java |  5 ++++
 .../component/google/sheets/google-sheets.json     |  2 ++
 .../src/main/docs/google-sheets-component.adoc     | 25 +++++++++++++---
 .../main/docs/google-sheets-stream-component.adoc  | 15 ++++++++++
 .../google/sheets/GoogleSheetsConfiguration.java   |  3 +-
 .../google/sheets/GoogleSheetsEndpoint.java        |  1 -
 .../dsl/GoogleSheetsComponentBuilderFactory.java   | 16 ++++++++++
 .../dsl/GoogleSheetsEndpointBuilderFactory.java    | 32 ++++++++++++++++++++
 .../component/AbstractApiConfiguration.java        | 35 ++++++++++++++++++++++
 .../support/component/AbstractApiEndpoint.java     | 10 +++++++
 .../ROOT/pages/google-sheets-component.adoc        | 25 +++++++++++++---
 .../ROOT/pages/google-sheets-stream-component.adoc | 15 ++++++++++
 .../src/main/resources/endpoint-options.mvel       |  8 +++++
 22 files changed, 256 insertions(+), 31 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-sheets-component.adoc
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-sheets-component.adoc
index 64e465b..127d348 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-sheets-component.adoc
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-sheets-component.adoc
@@ -57,7 +57,7 @@ Endpoint prefix can be one of:
 === Component options
 
 // component options: START
-The Google Sheets component supports 10 options, which are listed below.
+The Google Sheets component supports 11 options, which are listed below.
 
 
 
@@ -68,6 +68,7 @@ The Google Sheets component supports 10 options, which are 
listed below.
 | *clientId* (common) | Client ID of the sheets application |  | String
 | *configuration* (common) | To use the shared configuration |  | 
GoogleSheetsConfiguration
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions occurred while the 
consumer is trying to pickup incoming messages, or the likes, will now be 
processed as a message and handled by the routing Error Handler. By default the 
consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions, that will be logged at WARN or ERROR level and ignored. | false | 
boolean
+| *splitResult* (consumer) | When consumer return an array or collection this 
will generate one exchange per element, and their routes will be executed once 
for each exchange. Set this value to false to use a single exchange for the 
entire list or array. | true | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy 
(on the first message). By starting lazy you can use this to allow CamelContext 
and routes to startup in situations where a producer may otherwise fail during 
starting and cause the route to fail being started. By deferring this startup 
to be lazy then the startup failure can be handled during routing messages via 
Camel's routing error handlers. Beware that when the first message is processed 
then creating and [...]
 | *basicPropertyBinding* (advanced) | *Deprecated* Whether the component 
should use basic property binding (Camel 2.x) or the newer property binding 
with additional capabilities | false | boolean
 | *clientFactory* (advanced) | To use the GoogleSheetsClientFactory as factory 
for creating the client. Will by default use BatchGoogleSheetsClientFactory |  
| GoogleSheetsClientFactory
@@ -98,7 +99,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (28 parameters):
+=== Query Parameters (29 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -109,6 +110,7 @@ with the following path and query parameters:
 | *inBody* (common) | Sets the name of a parameter to be passed in the 
exchange In Body |  | String
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions occurred while the 
consumer is trying to pickup incoming messages, or the likes, will now be 
processed as a message and handled by the routing Error Handler. By default the 
consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions, that will be logged at WARN or ERROR level and ignored. | false | 
boolean
 | *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll 
any files, you can enable this option to send an empty message (no body) 
instead. | false | boolean
+| *splitResult* (consumer) | When consumer return an array or collection this 
will generate one exchange per element, and their routes will be executed once 
for each exchange. Set this value to false to use a single exchange for the 
entire list or array. | true | boolean
 | *exceptionHandler* (consumer) | To let the consumer use a custom 
ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this 
option is not in use. By default the consumer will deal with exceptions, that 
will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer 
creates an exchange. There are 3 enums and the value can be one of: InOnly, 
InOut, InOptionalOut |  | ExchangePattern
 | *pollStrategy* (consumer) | A pluggable 
org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your 
custom implementation to control error handling usually occurred during the 
poll operation before an Exchange have been created and being routed in Camel. 
|  | PollingConsumerPollStrategy
@@ -241,7 +243,7 @@ The data API method(s) has the following set of parameters 
listed in the table b
 | update | *values* |  The com.google.api.services.sheets.v4.model.ValueRange 
| ValueRange
 |===
 
-In addition to the parameters above, the data API can also use from the 28 
endpoint query option
+In addition to the parameters above, the data API can also use from the 29 
endpoint query option
 which is listed in the _Query Parameters_ section.
 
 Any of the parameters can be provided in either the endpoint URI, or 
dynamically in a message header.
@@ -250,6 +252,14 @@ The `inBody` parameter overrides message header, i.e. the 
endpoint parameter `in
 would override a `CamelGoogleSheets.myParameterNameHere` header.
 
 
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default Consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
+
+
+
 
 ==== API: spreadsheets
 
@@ -300,13 +310,20 @@ The spreadsheets API method(s) has the following set of 
parameters listed in the
 | getByDataFilter | *spreadsheetId* |  The spreadsheet to request | String
 |===
 
-In addition to the parameters above, the spreadsheets API can also use from 
the 28 endpoint query option
+In addition to the parameters above, the spreadsheets API can also use from 
the 29 endpoint query option
 which is listed in the _Query Parameters_ section.
 
 Any of the parameters can be provided in either the endpoint URI, or 
dynamically in a message header.
 The message header name must be of the format `CamelGoogleSheets.parameter`.
 The `inBody` parameter overrides message header, i.e. the endpoint parameter 
`inBody=myParameterNameHere`
 would override a `CamelGoogleSheets.myParameterNameHere` header.
+
+
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default Consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
 // endpoint options: END
 
 
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-sheets-stream-component.adoc
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-sheets-stream-component.adoc
index e59814a..bc13a34 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-sheets-stream-component.adoc
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-sheets-stream-component.adoc
@@ -259,6 +259,14 @@ The `inBody` parameter overrides message header, i.e. the 
endpoint parameter `in
 would override a `CamelGoogleSheetsStream.myParameterNameHere` header.
 
 
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default Consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
+
+
+
 
 ==== API: spreadsheets
 
@@ -316,6 +324,13 @@ Any of the parameters can be provided in either the 
endpoint URI, or dynamically
 The message header name must be of the format 
`CamelGoogleSheetsStream.parameter`.
 The `inBody` parameter overrides message header, i.e. the endpoint parameter 
`inBody=myParameterNameHere`
 would override a `CamelGoogleSheetsStream.myParameterNameHere` header.
+
+
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default Consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
 // endpoint options: END
 
 == More information
diff --git 
a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Configuration.java
 
b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Configuration.java
index 7d1f505..4883814 100644
--- 
a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Configuration.java
+++ 
b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Configuration.java
@@ -30,6 +30,7 @@ import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriParams;
 import org.apache.camel.spi.UriPath;
+import org.apache.camel.support.component.AbstractApiConfiguration;
 import org.apache.http.entity.ContentType;
 
 /**
@@ -37,7 +38,7 @@ import org.apache.http.entity.ContentType;
  */
 @UriParams
 @Configurer
-public class AS2Configuration {
+public class AS2Configuration extends AbstractApiConfiguration {
 
     @UriPath
     @Metadata(required = true, enums = "client,server")
diff --git 
a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Consumer.java
 
b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Consumer.java
index c1b70b7..6290661 100644
--- 
a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Consumer.java
+++ 
b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Consumer.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.as2;
 
-import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
@@ -55,11 +54,8 @@ public class AS2Consumer extends 
AbstractApiConsumer<AS2ApiName, AS2Configuratio
     private static final String REQUEST_URI_PROPERTY = "requestUri";
 
     private AS2ServerConnection as2ServerConnection;
-
     private AS2ServerManager apiProxy;
-
     private final ApiMethod apiMethod;
-
     private final Map<String, Object> properties;
 
     public AS2Consumer(AS2Endpoint endpoint, Processor processor) {
@@ -67,15 +63,9 @@ public class AS2Consumer extends 
AbstractApiConsumer<AS2ApiName, AS2Configuratio
 
         apiMethod = ApiConsumerHelper.findMethod(endpoint, this);
 
-        // Add listener property to register this consumer as listener for
-        // events.
         properties = new HashMap<>();
         properties.putAll(endpoint.getEndpointProperties());
         properties.put(HANDLER_PROPERTY, this);
-
-        as2ServerConnection = endpoint.getAS2ServerConnection();
-
-        apiProxy = new AS2ServerManager(as2ServerConnection);
     }
 
     @Override
@@ -89,25 +79,36 @@ public class AS2Consumer extends 
AbstractApiConsumer<AS2ApiName, AS2Configuratio
     }
 
     @Override
+    public AS2Endpoint getEndpoint() {
+        return (AS2Endpoint) super.getEndpoint();
+    }
+
+    @Override
     protected void doStart() throws Exception {
         super.doStart();
 
+        // Add listener property to register this consumer as listener for 
events
+        as2ServerConnection = getEndpoint().getAS2ServerConnection();
+        apiProxy = new AS2ServerManager(as2ServerConnection);
+
         // invoke the API method to start listening
         ApiMethodHelper.invokeMethod(apiProxy, apiMethod, properties);
     }
 
     @Override
     protected void doStop() throws Exception {
-        String requestUri = (String) properties.get(REQUEST_URI_PROPERTY);
-        apiProxy.stopListening(requestUri);
+        if (apiProxy != null) {
+            String requestUri = (String) properties.get(REQUEST_URI_PROPERTY);
+            apiProxy.stopListening(requestUri);
+        }
 
         super.doStop();
     }
 
     @Override
     public void handle(HttpRequest request, HttpResponse response, HttpContext 
context)
-            throws HttpException, IOException {
-        Exception exception = null;
+            throws HttpException {
+        Exception exception;
         try {
             if (request instanceof HttpEntityEnclosingRequest) {
                 EntityParser.parseAS2MessageEntity(request);
@@ -133,7 +134,7 @@ public class AS2Consumer extends 
AbstractApiConsumer<AS2ApiName, AS2Configuratio
                 exception = exchange.getException();
             }
         } catch (Exception e) {
-            LOG.info("Failed to process AS2 message", e);
+            LOG.warn("Failed to process AS2 message", e);
             exception = e;
         }
 
diff --git 
a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java
 
b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java
index 934af84..20704b5 100644
--- 
a/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java
+++ 
b/components/camel-as2/camel-as2-component/src/main/java/org/apache/camel/component/as2/AS2Endpoint.java
@@ -90,7 +90,6 @@ public class AS2Endpoint extends 
AbstractApiEndpoint<AS2ApiName, AS2Configuratio
             throw new IllegalArgumentException("Option inBody is not supported 
for consumer endpoint");
         }
         final AS2Consumer consumer = new AS2Consumer(this, processor);
-        // also set consumer.* properties
         configureConsumer(consumer);
         return consumer;
     }
diff --git 
a/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/GoogleSheetsComponentConfigurer.java
 
b/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/GoogleSheetsComponentConfigurer.java
index 523773c..a0d8e09 100644
--- 
a/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/GoogleSheetsComponentConfigurer.java
+++ 
b/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/GoogleSheetsComponentConfigurer.java
@@ -45,6 +45,8 @@ public class GoogleSheetsComponentConfigurer extends 
PropertyConfigurerSupport i
         case "lazyStartProducer": 
target.setLazyStartProducer(property(camelContext, boolean.class, value)); 
return true;
         case "refreshtoken":
         case "refreshToken": 
getOrCreateConfiguration(target).setRefreshToken(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "splitresult":
+        case "splitResult": 
getOrCreateConfiguration(target).setSplitResult(property(camelContext, 
boolean.class, value)); return true;
         default: return false;
         }
     }
@@ -62,6 +64,7 @@ public class GoogleSheetsComponentConfigurer extends 
PropertyConfigurerSupport i
         answer.put("configuration", 
org.apache.camel.component.google.sheets.GoogleSheetsConfiguration.class);
         answer.put("lazyStartProducer", boolean.class);
         answer.put("refreshToken", java.lang.String.class);
+        answer.put("splitResult", boolean.class);
         return answer;
     }
 
@@ -88,6 +91,8 @@ public class GoogleSheetsComponentConfigurer extends 
PropertyConfigurerSupport i
         case "lazyStartProducer": return target.isLazyStartProducer();
         case "refreshtoken":
         case "refreshToken": return 
getOrCreateConfiguration(target).getRefreshToken();
+        case "splitresult":
+        case "splitResult": return 
getOrCreateConfiguration(target).isSplitResult();
         default: return null;
         }
     }
diff --git 
a/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/GoogleSheetsConfigurationConfigurer.java
 
b/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/GoogleSheetsConfigurationConfigurer.java
index e9d32b4..5b32a65 100644
--- 
a/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/GoogleSheetsConfigurationConfigurer.java
+++ 
b/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/GoogleSheetsConfigurationConfigurer.java
@@ -33,6 +33,8 @@ public class GoogleSheetsConfigurationConfigurer extends 
org.apache.camel.suppor
         case "MethodName": target.setMethodName(property(camelContext, 
java.lang.String.class, value)); return true;
         case "refreshtoken":
         case "RefreshToken": target.setRefreshToken(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "splitresult":
+        case "SplitResult": target.setSplitResult(property(camelContext, 
boolean.class, value)); return true;
         default: return false;
         }
     }
@@ -47,6 +49,7 @@ public class GoogleSheetsConfigurationConfigurer extends 
org.apache.camel.suppor
         answer.put("ClientSecret", java.lang.String.class);
         answer.put("MethodName", java.lang.String.class);
         answer.put("RefreshToken", java.lang.String.class);
+        answer.put("SplitResult", boolean.class);
         return answer;
     }
 
@@ -68,6 +71,8 @@ public class GoogleSheetsConfigurationConfigurer extends 
org.apache.camel.suppor
         case "MethodName": return target.getMethodName();
         case "refreshtoken":
         case "RefreshToken": return target.getRefreshToken();
+        case "splitresult":
+        case "SplitResult": return target.isSplitResult();
         default: return null;
         }
     }
diff --git 
a/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/GoogleSheetsEndpointConfigurer.java
 
b/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/GoogleSheetsEndpointConfigurer.java
index 15491d3..5e7971f 100644
--- 
a/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/GoogleSheetsEndpointConfigurer.java
+++ 
b/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/GoogleSheetsEndpointConfigurer.java
@@ -64,6 +64,8 @@ public class GoogleSheetsEndpointConfigurer extends 
PropertyConfigurerSupport im
         case "schedulerProperties": 
target.setSchedulerProperties(property(camelContext, java.util.Map.class, 
value)); return true;
         case "sendemptymessagewhenidle":
         case "sendEmptyMessageWhenIdle": 
target.setSendEmptyMessageWhenIdle(property(camelContext, boolean.class, 
value)); return true;
+        case "splitresult":
+        case "splitResult": 
target.getConfiguration().setSplitResult(property(camelContext, boolean.class, 
value)); return true;
         case "startscheduler":
         case "startScheduler": target.setStartScheduler(property(camelContext, 
boolean.class, value)); return true;
         case "synchronous": target.setSynchronous(property(camelContext, 
boolean.class, value)); return true;
@@ -102,6 +104,7 @@ public class GoogleSheetsEndpointConfigurer extends 
PropertyConfigurerSupport im
         answer.put("scheduler", java.lang.Object.class);
         answer.put("schedulerProperties", java.util.Map.class);
         answer.put("sendEmptyMessageWhenIdle", boolean.class);
+        answer.put("splitResult", boolean.class);
         answer.put("startScheduler", boolean.class);
         answer.put("synchronous", boolean.class);
         answer.put("timeUnit", java.util.concurrent.TimeUnit.class);
@@ -158,6 +161,8 @@ public class GoogleSheetsEndpointConfigurer extends 
PropertyConfigurerSupport im
         case "schedulerProperties": return target.getSchedulerProperties();
         case "sendemptymessagewhenidle":
         case "sendEmptyMessageWhenIdle": return 
target.isSendEmptyMessageWhenIdle();
+        case "splitresult":
+        case "splitResult": return target.getConfiguration().isSplitResult();
         case "startscheduler":
         case "startScheduler": return target.isStartScheduler();
         case "synchronous": return target.isSynchronous();
diff --git 
a/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsEndpointConfigurationConfigurer.java
 
b/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsEndpointConfigurationConfigurer.java
index 452f379..1a05b83 100644
--- 
a/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsEndpointConfigurationConfigurer.java
+++ 
b/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsEndpointConfigurationConfigurer.java
@@ -39,6 +39,8 @@ public class 
SheetsSpreadsheetsEndpointConfigurationConfigurer extends org.apach
         case "MethodName": target.setMethodName(property(camelContext, 
java.lang.String.class, value)); return true;
         case "refreshtoken":
         case "RefreshToken": target.setRefreshToken(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "splitresult":
+        case "SplitResult": target.setSplitResult(property(camelContext, 
boolean.class, value)); return true;
         case "spreadsheetid":
         case "SpreadsheetId": target.setSpreadsheetId(property(camelContext, 
java.lang.String.class, value)); return true;
         default: return false;
@@ -58,6 +60,7 @@ public class 
SheetsSpreadsheetsEndpointConfigurationConfigurer extends org.apach
         answer.put("GetSpreadsheetByDataFilterRequest", 
com.google.api.services.sheets.v4.model.GetSpreadsheetByDataFilterRequest.class);
         answer.put("MethodName", java.lang.String.class);
         answer.put("RefreshToken", java.lang.String.class);
+        answer.put("SplitResult", boolean.class);
         answer.put("SpreadsheetId", java.lang.String.class);
         return answer;
     }
@@ -86,6 +89,8 @@ public class 
SheetsSpreadsheetsEndpointConfigurationConfigurer extends org.apach
         case "MethodName": return target.getMethodName();
         case "refreshtoken":
         case "RefreshToken": return target.getRefreshToken();
+        case "splitresult":
+        case "SplitResult": return target.isSplitResult();
         case "spreadsheetid":
         case "SpreadsheetId": return target.getSpreadsheetId();
         default: return null;
diff --git 
a/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsValuesEndpointConfigurationConfigurer.java
 
b/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsValuesEndpointConfigurationConfigurer.java
index 65087fb..b80b2d3 100644
--- 
a/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsValuesEndpointConfigurationConfigurer.java
+++ 
b/components/camel-google-sheets/src/generated/java/org/apache/camel/component/google/sheets/SheetsSpreadsheetsValuesEndpointConfigurationConfigurer.java
@@ -47,6 +47,8 @@ public class 
SheetsSpreadsheetsValuesEndpointConfigurationConfigurer extends org
         case "Range": target.setRange(property(camelContext, 
java.lang.String.class, value)); return true;
         case "refreshtoken":
         case "RefreshToken": target.setRefreshToken(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "splitresult":
+        case "SplitResult": target.setSplitResult(property(camelContext, 
boolean.class, value)); return true;
         case "spreadsheetid":
         case "SpreadsheetId": target.setSpreadsheetId(property(camelContext, 
java.lang.String.class, value)); return true;
         case "values":
@@ -72,6 +74,7 @@ public class 
SheetsSpreadsheetsValuesEndpointConfigurationConfigurer extends org
         answer.put("MethodName", java.lang.String.class);
         answer.put("Range", java.lang.String.class);
         answer.put("RefreshToken", java.lang.String.class);
+        answer.put("SplitResult", boolean.class);
         answer.put("SpreadsheetId", java.lang.String.class);
         answer.put("Values", 
com.google.api.services.sheets.v4.model.ValueRange.class);
         return answer;
@@ -109,6 +112,8 @@ public class 
SheetsSpreadsheetsValuesEndpointConfigurationConfigurer extends org
         case "Range": return target.getRange();
         case "refreshtoken":
         case "RefreshToken": return target.getRefreshToken();
+        case "splitresult":
+        case "SplitResult": return target.isSplitResult();
         case "spreadsheetid":
         case "SpreadsheetId": return target.getSpreadsheetId();
         case "values":
diff --git 
a/components/camel-google-sheets/src/generated/resources/org/apache/camel/component/google/sheets/google-sheets.json
 
b/components/camel-google-sheets/src/generated/resources/org/apache/camel/component/google/sheets/google-sheets.json
index 72a38e7..9091baa 100644
--- 
a/components/camel-google-sheets/src/generated/resources/org/apache/camel/component/google/sheets/google-sheets.json
+++ 
b/components/camel-google-sheets/src/generated/resources/org/apache/camel/component/google/sheets/google-sheets.json
@@ -28,6 +28,7 @@
     "clientId": { "kind": "property", "displayName": "Client Id", "group": 
"common", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "secret": false, "configurationClass": 
"org.apache.camel.component.google.sheets.GoogleSheetsConfiguration", 
"configurationField": "configuration", "description": "Client ID of the sheets 
application" },
     "configuration": { "kind": "property", "displayName": "Configuration", 
"group": "common", "label": "", "required": false, "type": "object", 
"javaType": 
"org.apache.camel.component.google.sheets.GoogleSheetsConfiguration", 
"deprecated": false, "secret": false, "description": "To use the shared 
configuration" },
     "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error 
Handler", "group": "consumer", "label": "consumer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "secret": false, 
"defaultValue": false, "description": "Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions occurred while the 
consumer is trying to pickup incoming messages, or the likes, will now be 
processed as a message and handled by [...]
+    "splitResult": { "kind": "property", "displayName": "Split Result", 
"group": "consumer", "label": "consumer", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": 
"true", "configurationClass": 
"org.apache.camel.component.google.sheets.GoogleSheetsConfiguration", 
"configurationField": "configuration", "description": "When consumer return an 
array or collection this will generate one exchange per element, and their 
routes wi [...]
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start 
Producer", "group": "producer", "label": "producer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "secret": false, 
"defaultValue": false, "description": "Whether the producer should be started 
lazy (on the first message). By starting lazy you can use this to allow 
CamelContext and routes to startup in situations where a producer may otherwise 
fail during starting and cause the r [...]
     "basicPropertyBinding": { "kind": "property", "displayName": "Basic 
Property Binding", "group": "advanced", "label": "advanced", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": true, "secret": false, 
"defaultValue": false, "description": "Whether the component should use basic 
property binding (Camel 2.x) or the newer property binding with additional 
capabilities" },
     "clientFactory": { "kind": "property", "displayName": "Client Factory", 
"group": "advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": 
"org.apache.camel.component.google.sheets.GoogleSheetsClientFactory", 
"deprecated": false, "secret": false, "description": "To use the 
GoogleSheetsClientFactory as factory for creating the client. Will by default 
use BatchGoogleSheetsClientFactory" },
@@ -43,6 +44,7 @@
     "inBody": { "kind": "parameter", "displayName": "In Body", "group": 
"common", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "secret": false, "description": "Sets 
the name of a parameter to be passed in the exchange In Body" },
     "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error 
Handler", "group": "consumer", "label": "consumer", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "secret": false, 
"defaultValue": false, "description": "Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions occurred while the 
consumer is trying to pickup incoming messages, or the likes, will now be 
processed as a message and handled b [...]
     "sendEmptyMessageWhenIdle": { "kind": "parameter", "displayName": "Send 
Empty Message When Idle", "group": "consumer", "label": "consumer", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": 
false, "defaultValue": false, "description": "If the polling consumer did not 
poll any files, you can enable this option to send an empty message (no body) 
instead." },
+    "splitResult": { "kind": "parameter", "displayName": "Split Result", 
"group": "consumer", "label": "consumer", "required": false, "type": "boolean", 
"javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": 
"true", "configurationClass": 
"org.apache.camel.component.google.sheets.GoogleSheetsConfiguration", 
"configurationField": "configuration", "description": "When consumer return an 
array or collection this will generate one exchange per element, and their 
routes w [...]
     "exceptionHandler": { "kind": "parameter", "displayName": "Exception 
Handler", "group": "consumer (advanced)", "label": "consumer,advanced", 
"required": false, "type": "object", "javaType": 
"org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", 
"deprecated": false, "secret": false, "description": "To let the consumer use a 
custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled 
then this option is not in use. By default the consumer will deal with [...]
     "exchangePattern": { "kind": "parameter", "displayName": "Exchange 
Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", 
"required": false, "type": "object", "javaType": 
"org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", 
"InOptionalOut" ], "deprecated": false, "secret": false, "description": "Sets 
the exchange pattern when the consumer creates an exchange." },
     "pollStrategy": { "kind": "parameter", "displayName": "Poll Strategy", 
"group": "consumer (advanced)", "label": "consumer,advanced", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.spi.PollingConsumerPollStrategy", "deprecated": false, 
"secret": false, "description": "A pluggable 
org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your 
custom implementation to control error handling usually occurred during the 
poll operation before an Exchange h [...]
diff --git 
a/components/camel-google-sheets/src/main/docs/google-sheets-component.adoc 
b/components/camel-google-sheets/src/main/docs/google-sheets-component.adoc
index 64e465b..127d348 100644
--- a/components/camel-google-sheets/src/main/docs/google-sheets-component.adoc
+++ b/components/camel-google-sheets/src/main/docs/google-sheets-component.adoc
@@ -57,7 +57,7 @@ Endpoint prefix can be one of:
 === Component options
 
 // component options: START
-The Google Sheets component supports 10 options, which are listed below.
+The Google Sheets component supports 11 options, which are listed below.
 
 
 
@@ -68,6 +68,7 @@ The Google Sheets component supports 10 options, which are 
listed below.
 | *clientId* (common) | Client ID of the sheets application |  | String
 | *configuration* (common) | To use the shared configuration |  | 
GoogleSheetsConfiguration
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions occurred while the 
consumer is trying to pickup incoming messages, or the likes, will now be 
processed as a message and handled by the routing Error Handler. By default the 
consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions, that will be logged at WARN or ERROR level and ignored. | false | 
boolean
+| *splitResult* (consumer) | When consumer return an array or collection this 
will generate one exchange per element, and their routes will be executed once 
for each exchange. Set this value to false to use a single exchange for the 
entire list or array. | true | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy 
(on the first message). By starting lazy you can use this to allow CamelContext 
and routes to startup in situations where a producer may otherwise fail during 
starting and cause the route to fail being started. By deferring this startup 
to be lazy then the startup failure can be handled during routing messages via 
Camel's routing error handlers. Beware that when the first message is processed 
then creating and [...]
 | *basicPropertyBinding* (advanced) | *Deprecated* Whether the component 
should use basic property binding (Camel 2.x) or the newer property binding 
with additional capabilities | false | boolean
 | *clientFactory* (advanced) | To use the GoogleSheetsClientFactory as factory 
for creating the client. Will by default use BatchGoogleSheetsClientFactory |  
| GoogleSheetsClientFactory
@@ -98,7 +99,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (28 parameters):
+=== Query Parameters (29 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -109,6 +110,7 @@ with the following path and query parameters:
 | *inBody* (common) | Sets the name of a parameter to be passed in the 
exchange In Body |  | String
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions occurred while the 
consumer is trying to pickup incoming messages, or the likes, will now be 
processed as a message and handled by the routing Error Handler. By default the 
consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions, that will be logged at WARN or ERROR level and ignored. | false | 
boolean
 | *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll 
any files, you can enable this option to send an empty message (no body) 
instead. | false | boolean
+| *splitResult* (consumer) | When consumer return an array or collection this 
will generate one exchange per element, and their routes will be executed once 
for each exchange. Set this value to false to use a single exchange for the 
entire list or array. | true | boolean
 | *exceptionHandler* (consumer) | To let the consumer use a custom 
ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this 
option is not in use. By default the consumer will deal with exceptions, that 
will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer 
creates an exchange. There are 3 enums and the value can be one of: InOnly, 
InOut, InOptionalOut |  | ExchangePattern
 | *pollStrategy* (consumer) | A pluggable 
org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your 
custom implementation to control error handling usually occurred during the 
poll operation before an Exchange have been created and being routed in Camel. 
|  | PollingConsumerPollStrategy
@@ -241,7 +243,7 @@ The data API method(s) has the following set of parameters 
listed in the table b
 | update | *values* |  The com.google.api.services.sheets.v4.model.ValueRange 
| ValueRange
 |===
 
-In addition to the parameters above, the data API can also use from the 28 
endpoint query option
+In addition to the parameters above, the data API can also use from the 29 
endpoint query option
 which is listed in the _Query Parameters_ section.
 
 Any of the parameters can be provided in either the endpoint URI, or 
dynamically in a message header.
@@ -250,6 +252,14 @@ The `inBody` parameter overrides message header, i.e. the 
endpoint parameter `in
 would override a `CamelGoogleSheets.myParameterNameHere` header.
 
 
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default Consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
+
+
+
 
 ==== API: spreadsheets
 
@@ -300,13 +310,20 @@ The spreadsheets API method(s) has the following set of 
parameters listed in the
 | getByDataFilter | *spreadsheetId* |  The spreadsheet to request | String
 |===
 
-In addition to the parameters above, the spreadsheets API can also use from 
the 28 endpoint query option
+In addition to the parameters above, the spreadsheets API can also use from 
the 29 endpoint query option
 which is listed in the _Query Parameters_ section.
 
 Any of the parameters can be provided in either the endpoint URI, or 
dynamically in a message header.
 The message header name must be of the format `CamelGoogleSheets.parameter`.
 The `inBody` parameter overrides message header, i.e. the endpoint parameter 
`inBody=myParameterNameHere`
 would override a `CamelGoogleSheets.myParameterNameHere` header.
+
+
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default Consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
 // endpoint options: END
 
 
diff --git 
a/components/camel-google-sheets/src/main/docs/google-sheets-stream-component.adoc
 
b/components/camel-google-sheets/src/main/docs/google-sheets-stream-component.adoc
index e59814a..bc13a34 100644
--- 
a/components/camel-google-sheets/src/main/docs/google-sheets-stream-component.adoc
+++ 
b/components/camel-google-sheets/src/main/docs/google-sheets-stream-component.adoc
@@ -259,6 +259,14 @@ The `inBody` parameter overrides message header, i.e. the 
endpoint parameter `in
 would override a `CamelGoogleSheetsStream.myParameterNameHere` header.
 
 
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default Consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
+
+
+
 
 ==== API: spreadsheets
 
@@ -316,6 +324,13 @@ Any of the parameters can be provided in either the 
endpoint URI, or dynamically
 The message header name must be of the format 
`CamelGoogleSheetsStream.parameter`.
 The `inBody` parameter overrides message header, i.e. the endpoint parameter 
`inBody=myParameterNameHere`
 would override a `CamelGoogleSheetsStream.myParameterNameHere` header.
+
+
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default Consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
 // endpoint options: END
 
 == More information
diff --git 
a/components/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/GoogleSheetsConfiguration.java
 
b/components/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/GoogleSheetsConfiguration.java
index f37df0f..3906b84 100644
--- 
a/components/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/GoogleSheetsConfiguration.java
+++ 
b/components/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/GoogleSheetsConfiguration.java
@@ -22,13 +22,14 @@ import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriParams;
 import org.apache.camel.spi.UriPath;
+import org.apache.camel.support.component.AbstractApiConfiguration;
 
 /**
  * Component configuration for GoogleSheets component.
  */
 @UriParams
 @Configurer
-public class GoogleSheetsConfiguration {
+public class GoogleSheetsConfiguration extends AbstractApiConfiguration {
 
     @UriPath
     @Metadata(required = true)
diff --git 
a/components/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/GoogleSheetsEndpoint.java
 
b/components/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/GoogleSheetsEndpoint.java
index 09f4359..c8987ed 100644
--- 
a/components/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/GoogleSheetsEndpoint.java
+++ 
b/components/camel-google-sheets/src/main/java/org/apache/camel/component/google/sheets/GoogleSheetsEndpoint.java
@@ -38,7 +38,6 @@ import 
org.apache.camel.support.component.ApiMethodPropertiesHelper;
  */
 @UriEndpoint(firstVersion = "2.23.0", scheme = "google-sheets", title = 
"Google Sheets",
              syntax = "google-sheets:apiName/methodName", apiSyntax = 
"apiName/methodName",
-             consumerPrefix = "consumer",
              category = { Category.API, Category.CLOUD, Category.SHEETS })
 public class GoogleSheetsEndpoint extends 
AbstractApiEndpoint<GoogleSheetsApiName, GoogleSheetsConfiguration> {
 
diff --git 
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GoogleSheetsComponentBuilderFactory.java
 
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GoogleSheetsComponentBuilderFactory.java
index c92972e..d0d89fe 100644
--- 
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GoogleSheetsComponentBuilderFactory.java
+++ 
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GoogleSheetsComponentBuilderFactory.java
@@ -105,6 +105,21 @@ public interface GoogleSheetsComponentBuilderFactory {
             return this;
         }
         /**
+         * When consumer return an array or collection this will generate one
+         * exchange per element, and their routes will be executed once for 
each
+         * exchange. Set this value to false to use a single exchange for the
+         * entire list or array.
+         * 
+         * The option is a: <code>boolean</code> type.
+         * 
+         * Default: true
+         * Group: consumer
+         */
+        default GoogleSheetsComponentBuilder splitResult(boolean splitResult) {
+            doSetProperty("splitResult", splitResult);
+            return this;
+        }
+        /**
          * Whether the producer should be started lazy (on the first message).
          * By starting lazy you can use this to allow CamelContext and routes 
to
          * startup in situations where a producer may otherwise fail during
@@ -221,6 +236,7 @@ public interface GoogleSheetsComponentBuilderFactory {
             case "clientId": getOrCreateConfiguration((GoogleSheetsComponent) 
component).setClientId((java.lang.String) value); return true;
             case "configuration": ((GoogleSheetsComponent) 
component).setConfiguration((org.apache.camel.component.google.sheets.GoogleSheetsConfiguration)
 value); return true;
             case "bridgeErrorHandler": ((GoogleSheetsComponent) 
component).setBridgeErrorHandler((boolean) value); return true;
+            case "splitResult": 
getOrCreateConfiguration((GoogleSheetsComponent) 
component).setSplitResult((boolean) value); return true;
             case "lazyStartProducer": ((GoogleSheetsComponent) 
component).setLazyStartProducer((boolean) value); return true;
             case "basicPropertyBinding": ((GoogleSheetsComponent) 
component).setBasicPropertyBinding((boolean) value); return true;
             case "clientFactory": ((GoogleSheetsComponent) 
component).setClientFactory((org.apache.camel.component.google.sheets.GoogleSheetsClientFactory)
 value); return true;
diff --git 
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleSheetsEndpointBuilderFactory.java
 
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleSheetsEndpointBuilderFactory.java
index 08e288f..2339bf5 100644
--- 
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleSheetsEndpointBuilderFactory.java
+++ 
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleSheetsEndpointBuilderFactory.java
@@ -148,6 +148,38 @@ public interface GoogleSheetsEndpointBuilderFactory {
             return this;
         }
         /**
+         * When consumer return an array or collection this will generate one
+         * exchange per element, and their routes will be executed once for 
each
+         * exchange. Set this value to false to use a single exchange for the
+         * entire list or array.
+         * 
+         * The option is a: <code>boolean</code> type.
+         * 
+         * Default: true
+         * Group: consumer
+         */
+        default GoogleSheetsEndpointConsumerBuilder splitResult(
+                boolean splitResult) {
+            doSetProperty("splitResult", splitResult);
+            return this;
+        }
+        /**
+         * When consumer return an array or collection this will generate one
+         * exchange per element, and their routes will be executed once for 
each
+         * exchange. Set this value to false to use a single exchange for the
+         * entire list or array.
+         * 
+         * The option will be converted to a <code>boolean</code> type.
+         * 
+         * Default: true
+         * Group: consumer
+         */
+        default GoogleSheetsEndpointConsumerBuilder splitResult(
+                String splitResult) {
+            doSetProperty("splitResult", splitResult);
+            return this;
+        }
+        /**
          * The number of subsequent error polls (failed due some error) that
          * should happen before the backoffMultipler should kick-in.
          * 
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiConfiguration.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiConfiguration.java
new file mode 100644
index 0000000..e0d120d
--- /dev/null
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiConfiguration.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.support.component;
+
+import org.apache.camel.spi.UriParam;
+
+public class AbstractApiConfiguration {
+
+    @UriParam(label = "consumer", defaultValue = "true",
+              description = "When consumer return an array or collection this 
will generate one exchange per element, and their routes will be executed once 
for each exchange. Set this value to false to use a single exchange for the 
entire list or array.")
+    private boolean splitResult;
+
+    public boolean isSplitResult() {
+        return splitResult;
+    }
+
+    public void setSplitResult(boolean splitResult) {
+        this.splitResult = splitResult;
+    }
+
+}
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiEndpoint.java
 
b/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiEndpoint.java
index 0a187b4..a60fa2a 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiEndpoint.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/component/AbstractApiEndpoint.java
@@ -29,6 +29,7 @@ import java.util.concurrent.ExecutorService;
 import org.apache.camel.ApiEndpoint;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Component;
+import org.apache.camel.Consumer;
 import org.apache.camel.spi.ExecutorServiceManager;
 import org.apache.camel.spi.ThreadPoolProfile;
 import org.apache.camel.spi.UriParam;
@@ -153,6 +154,15 @@ public abstract class AbstractApiEndpoint<E extends 
ApiName, T>
     }
 
     @Override
+    protected void configureConsumer(Consumer consumer) throws Exception {
+        super.configureConsumer(consumer);
+        if (getConfiguration() instanceof AbstractApiConfiguration && consumer 
instanceof AbstractApiConsumer) {
+            ((AbstractApiConsumer<?, ?>) consumer)
+                    .setSplitResult(((AbstractApiConfiguration) 
getConfiguration()).isSplitResult());
+        }
+    }
+
+    @Override
     public void interceptPropertyNames(Set<String> propertyNames) {
         // do nothing by default
     }
diff --git a/docs/components/modules/ROOT/pages/google-sheets-component.adoc 
b/docs/components/modules/ROOT/pages/google-sheets-component.adoc
index 67cdc01..ea29fb5 100644
--- a/docs/components/modules/ROOT/pages/google-sheets-component.adoc
+++ b/docs/components/modules/ROOT/pages/google-sheets-component.adoc
@@ -59,7 +59,7 @@ Endpoint prefix can be one of:
 === Component options
 
 // component options: START
-The Google Sheets component supports 10 options, which are listed below.
+The Google Sheets component supports 11 options, which are listed below.
 
 
 
@@ -70,6 +70,7 @@ The Google Sheets component supports 10 options, which are 
listed below.
 | *clientId* (common) | Client ID of the sheets application |  | String
 | *configuration* (common) | To use the shared configuration |  | 
GoogleSheetsConfiguration
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions occurred while the 
consumer is trying to pickup incoming messages, or the likes, will now be 
processed as a message and handled by the routing Error Handler. By default the 
consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions, that will be logged at WARN or ERROR level and ignored. | false | 
boolean
+| *splitResult* (consumer) | When consumer return an array or collection this 
will generate one exchange per element, and their routes will be executed once 
for each exchange. Set this value to false to use a single exchange for the 
entire list or array. | true | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy 
(on the first message). By starting lazy you can use this to allow CamelContext 
and routes to startup in situations where a producer may otherwise fail during 
starting and cause the route to fail being started. By deferring this startup 
to be lazy then the startup failure can be handled during routing messages via 
Camel's routing error handlers. Beware that when the first message is processed 
then creating and [...]
 | *basicPropertyBinding* (advanced) | *Deprecated* Whether the component 
should use basic property binding (Camel 2.x) or the newer property binding 
with additional capabilities | false | boolean
 | *clientFactory* (advanced) | To use the GoogleSheetsClientFactory as factory 
for creating the client. Will by default use BatchGoogleSheetsClientFactory |  
| GoogleSheetsClientFactory
@@ -100,7 +101,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (28 parameters):
+=== Query Parameters (29 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -111,6 +112,7 @@ with the following path and query parameters:
 | *inBody* (common) | Sets the name of a parameter to be passed in the 
exchange In Body |  | String
 | *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions occurred while the 
consumer is trying to pickup incoming messages, or the likes, will now be 
processed as a message and handled by the routing Error Handler. By default the 
consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions, that will be logged at WARN or ERROR level and ignored. | false | 
boolean
 | *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll 
any files, you can enable this option to send an empty message (no body) 
instead. | false | boolean
+| *splitResult* (consumer) | When consumer return an array or collection this 
will generate one exchange per element, and their routes will be executed once 
for each exchange. Set this value to false to use a single exchange for the 
entire list or array. | true | boolean
 | *exceptionHandler* (consumer) | To let the consumer use a custom 
ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this 
option is not in use. By default the consumer will deal with exceptions, that 
will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer 
creates an exchange. There are 3 enums and the value can be one of: InOnly, 
InOut, InOptionalOut |  | ExchangePattern
 | *pollStrategy* (consumer) | A pluggable 
org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your 
custom implementation to control error handling usually occurred during the 
poll operation before an Exchange have been created and being routed in Camel. 
|  | PollingConsumerPollStrategy
@@ -243,7 +245,7 @@ The data API method(s) has the following set of parameters 
listed in the table b
 | update | *values* |  The com.google.api.services.sheets.v4.model.ValueRange 
| ValueRange
 |===
 
-In addition to the parameters above, the data API can also use from the 28 
endpoint query option
+In addition to the parameters above, the data API can also use from the 29 
endpoint query option
 which is listed in the _Query Parameters_ section.
 
 Any of the parameters can be provided in either the endpoint URI, or 
dynamically in a message header.
@@ -252,6 +254,14 @@ The `inBody` parameter overrides message header, i.e. the 
endpoint parameter `in
 would override a `CamelGoogleSheets.myParameterNameHere` header.
 
 
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default Consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
+
+
+
 
 ==== API: spreadsheets
 
@@ -302,13 +312,20 @@ The spreadsheets API method(s) has the following set of 
parameters listed in the
 | getByDataFilter | *spreadsheetId* |  The spreadsheet to request | String
 |===
 
-In addition to the parameters above, the spreadsheets API can also use from 
the 28 endpoint query option
+In addition to the parameters above, the spreadsheets API can also use from 
the 29 endpoint query option
 which is listed in the _Query Parameters_ section.
 
 Any of the parameters can be provided in either the endpoint URI, or 
dynamically in a message header.
 The message header name must be of the format `CamelGoogleSheets.parameter`.
 The `inBody` parameter overrides message header, i.e. the endpoint parameter 
`inBody=myParameterNameHere`
 would override a `CamelGoogleSheets.myParameterNameHere` header.
+
+
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default Consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
 // endpoint options: END
 
 
diff --git 
a/docs/components/modules/ROOT/pages/google-sheets-stream-component.adoc 
b/docs/components/modules/ROOT/pages/google-sheets-stream-component.adoc
index 7689325..5a069e5 100644
--- a/docs/components/modules/ROOT/pages/google-sheets-stream-component.adoc
+++ b/docs/components/modules/ROOT/pages/google-sheets-stream-component.adoc
@@ -261,6 +261,14 @@ The `inBody` parameter overrides message header, i.e. the 
endpoint parameter `in
 would override a `CamelGoogleSheetsStream.myParameterNameHere` header.
 
 
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default Consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
+
+
+
 
 ==== API: spreadsheets
 
@@ -318,6 +326,13 @@ Any of the parameters can be provided in either the 
endpoint URI, or dynamically
 The message header name must be of the format 
`CamelGoogleSheetsStream.parameter`.
 The `inBody` parameter overrides message header, i.e. the endpoint parameter 
`inBody=myParameterNameHere`
 would override a `CamelGoogleSheetsStream.myParameterNameHere` header.
+
+
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default Consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
 // endpoint options: END
 
 == More information
diff --git 
a/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel
 
b/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel
index 904a7e7..aab767a 100644
--- 
a/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel
+++ 
b/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel
@@ -97,6 +97,14 @@ The message header name must be of the format 
`Camel@{util.componentName(scheme)
 The `inBody` parameter overrides message header, i.e. the endpoint parameter 
`inBody=myParameterNameHere`
 would override a `Camel@{util.componentName(scheme)}.myParameterNameHere` 
header.
 
+@if{!producerOnly}
+Any of the producer endpoints can be used as a consumer endpoint.
+Consumer endpoints can use Scheduled Poll Consumer Options to schedule 
endpoint invocation.
+By default consumer endpoints that return an array or collection will generate 
one exchange per element,
+and their routes will be executed once for each exchange. To change this 
behavior use the property `splitResults=false`
+to return a single exchange for the entire list or array.
+@end{}
+
 @end{}
 @end{}
 

Reply via email to