[camel] branch master updated (1b68ff1 -> 90eba92)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch master updated (1b68ff1 -> 90eba92)

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

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


    from 1b68ff1  CAMEL-14565: Add docs for missing option
     new bf23793  CAMEL-14565: Add docs for missing option
     new 90eba92  CAMEL-14565: Add docs for missing option

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../component/undertow/UndertowHostOptions.java    | 38 ++++----------------
 .../yammer/YammerComponentConfigurer.java          |  1 +
 .../component/yammer/YammerEndpointConfigurer.java |  1 +
 .../org/apache/camel/component/yammer/yammer.json  |  2 ++
 .../src/main/docs/yammer-component.adoc            |  6 ++--
 .../camel/component/yammer/YammerComponent.java    | 17 +++++++--
 .../component/yammer/YammerConfiguration.java      | 42 ++++++++--------------
 .../camel/component/yammer/YammerEndpoint.java     | 16 +++++++--
 .../yammer/YammerMessagePollingConsumer.java       | 23 ++++++++----
 .../component/yammer/YammerMessageProducer.java    | 22 ++++++++----
 .../yammer/YammerUserPollingConsumer.java          | 27 +++++++++-----
 .../yammer/YammerComponentTestSupport.java         | 27 ++++++--------
 .../yammer/YammerMessageAndUserRouteTest.java      | 14 ++++----
 .../dsl/YammerComponentBuilderFactory.java         | 14 ++++++++
 14 files changed, 140 insertions(+), 110 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[camel] 01/02: CAMEL-14565: Add docs for missing option

davsclaus-2
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 bf23793e28ca35c49bb78bb1f4645a893fc5846e
Author: Claus Ibsen <[hidden email]>
AuthorDate: Sat Feb 15 14:40:43 2020 +0100

    CAMEL-14565: Add docs for missing option
---
 .../component/undertow/UndertowHostOptions.java    | 38 ++++------------------
 1 file changed, 7 insertions(+), 31 deletions(-)

diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHostOptions.java b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHostOptions.java
index d1bccdc..48c36b2 100644
--- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHostOptions.java
+++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHostOptions.java
@@ -16,34 +16,22 @@
  */
 package org.apache.camel.component.undertow;
 
+import org.apache.camel.spi.Metadata;
+
 /**
  * Options to configure an Undertow host.
  */
 public final class UndertowHostOptions {
 
-    /**
-     * The number of worker threads to use in a Undertow host.
-     */
+    @Metadata(description = "The number of worker threads to use in a Undertow host.")
     private Integer workerThreads;
-
-    /**
-     * The number of io threads to use in a Undertow host.
-     */
+    @Metadata(description = "The number of io threads to use in a Undertow host.")
     private Integer ioThreads;
-
-    /**
-     * The buffer size of the Undertow host.
-     */
+    @Metadata(description = "The buffer size of the Undertow host.")
     private Integer bufferSize;
-
-    /**
-     * Set if the Undertow host should use direct buffers.
-     */
+    @Metadata(description = "Set if the Undertow host should use direct buffers.")
     private Boolean directBuffers;
-    
-    /**
-     * Set if the Undertow host should use http2 protocol.
-     */
+    @Metadata(description = "Set if the Undertow host should use http2 protocol.")
     private Boolean http2Enabled;
 
     public UndertowHostOptions() {
@@ -89,16 +77,4 @@ public final class UndertowHostOptions {
         this.http2Enabled = http2Enabled;
     }
 
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder("UndertowHostOptions{");
-        sb.append("workerThreads=").append(workerThreads);
-        sb.append(", ioThreads=").append(ioThreads);
-        sb.append(", bufferSize=").append(bufferSize);
-        sb.append(", directBuffers=").append(directBuffers);
-        sb.append(", http2Enabled=").append(http2Enabled);
-        sb.append('}');
-        return sb.toString();
-    }
-
 }

Reply | Threaded
Open this post in threaded view
|

[camel] 02/02: CAMEL-14565: Add docs for missing option

davsclaus-2
In reply to this post by davsclaus-2
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 90eba92a7d6598458b734b90bc134357a8429353
Author: Claus Ibsen <[hidden email]>
AuthorDate: Sat Feb 15 15:03:28 2020 +0100

    CAMEL-14565: Add docs for missing option
---
 .../yammer/YammerComponentConfigurer.java          |  1 +
 .../component/yammer/YammerEndpointConfigurer.java |  1 +
 .../org/apache/camel/component/yammer/yammer.json  |  2 ++
 .../src/main/docs/yammer-component.adoc            |  6 ++--
 .../camel/component/yammer/YammerComponent.java    | 17 +++++++--
 .../component/yammer/YammerConfiguration.java      | 42 ++++++++--------------
 .../camel/component/yammer/YammerEndpoint.java     | 16 +++++++--
 .../yammer/YammerMessagePollingConsumer.java       | 23 ++++++++----
 .../component/yammer/YammerMessageProducer.java    | 22 ++++++++----
 .../yammer/YammerUserPollingConsumer.java          | 27 +++++++++-----
 .../yammer/YammerComponentTestSupport.java         | 27 ++++++--------
 .../yammer/YammerMessageAndUserRouteTest.java      | 14 ++++----
 .../dsl/YammerComponentBuilderFactory.java         | 14 ++++++++
 13 files changed, 133 insertions(+), 79 deletions(-)

diff --git a/components/camel-yammer/src/generated/java/org/apache/camel/component/yammer/YammerComponentConfigurer.java b/components/camel-yammer/src/generated/java/org/apache/camel/component/yammer/YammerComponentConfigurer.java
index 54a93d8..2f896d1 100644
--- a/components/camel-yammer/src/generated/java/org/apache/camel/component/yammer/YammerComponentConfigurer.java
+++ b/components/camel-yammer/src/generated/java/org/apache/camel/component/yammer/YammerComponentConfigurer.java
@@ -22,6 +22,7 @@ public class YammerComponentConfigurer extends PropertyConfigurerSupport impleme
         case "basicpropertybinding":
         case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
         case "config": target.setConfig(property(camelContext, org.apache.camel.component.yammer.YammerConfiguration.class, value)); return true;
+        case "requestor": target.setRequestor(property(camelContext, org.apache.camel.component.yammer.ApiRequestor.class, value)); return true;
         case "accesstoken":
         case "accessToken": target.setAccessToken(property(camelContext, java.lang.String.class, value)); return true;
         case "consumerkey":
diff --git a/components/camel-yammer/src/generated/java/org/apache/camel/component/yammer/YammerEndpointConfigurer.java b/components/camel-yammer/src/generated/java/org/apache/camel/component/yammer/YammerEndpointConfigurer.java
index f076310f..e45fa9f 100644
--- a/components/camel-yammer/src/generated/java/org/apache/camel/component/yammer/YammerEndpointConfigurer.java
+++ b/components/camel-yammer/src/generated/java/org/apache/camel/component/yammer/YammerEndpointConfigurer.java
@@ -40,6 +40,7 @@ public class YammerEndpointConfigurer extends PropertyConfigurerSupport implemen
         case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
         case "basicpropertybinding":
         case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
+        case "requestor": target.getConfig().setRequestor(property(camelContext, org.apache.camel.component.yammer.ApiRequestor.class, value)); return true;
         case "synchronous": target.setSynchronous(property(camelContext, boolean.class, value)); return true;
         case "backofferrorthreshold":
         case "backoffErrorThreshold": target.setBackoffErrorThreshold(property(camelContext, int.class, value)); return true;
diff --git a/components/camel-yammer/src/generated/resources/org/apache/camel/component/yammer/yammer.json b/components/camel-yammer/src/generated/resources/org/apache/camel/component/yammer/yammer.json
index ec7a2df..e996f4c 100644
--- a/components/camel-yammer/src/generated/resources/org/apache/camel/component/yammer/yammer.json
+++ b/components/camel-yammer/src/generated/resources/org/apache/camel/component/yammer/yammer.json
@@ -23,6 +23,7 @@
     "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": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "config": { "kind": "property", "displayName": "Config", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.yammer.YammerConfiguration", "deprecated": false, "secret": false, "description": "To use a shared yammer configuration" },
+    "requestor": { "kind": "property", "displayName": "Requestor", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.yammer.ApiRequestor", "deprecated": false, "secret": false, "description": "To use a specific requester to communicate with Yammer." },
     "accessToken": { "kind": "property", "displayName": "Access Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "The access token" },
     "consumerKey": { "kind": "property", "displayName": "Consumer Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "The consumer key" },
     "consumerSecret": { "kind": "property", "displayName": "Consumer Secret", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "description": "The consumer secret" }
@@ -43,6 +44,7 @@
     "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 [...]
     "lazyStartProducer": { "kind": "parameter", "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  [...]
     "basicPropertyBinding": { "kind": "parameter", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
+    "requestor": { "kind": "parameter", "displayName": "Requestor", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.yammer.ApiRequestor", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.yammer.YammerConfiguration", "configurationField": "config", "description": "To use a specific requester to communicate with Yammer." },
     "synchronous": { "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported)." },
     "backoffErrorThreshold": { "kind": "parameter", "displayName": "Backoff Error Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "description": "The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in." },
     "backoffIdleThreshold": { "kind": "parameter", "displayName": "Backoff Idle Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "description": "The number of subsequent idle polls that should happen before the backoffMultipler should kick-in." },
diff --git a/components/camel-yammer/src/main/docs/yammer-component.adoc b/components/camel-yammer/src/main/docs/yammer-component.adoc
index 940020d..2235218 100644
--- a/components/camel-yammer/src/main/docs/yammer-component.adoc
+++ b/components/camel-yammer/src/main/docs/yammer-component.adoc
@@ -43,7 +43,7 @@ The Yammer component can be configured with the Yammer account settings which ar
 
 
 // component options: START
-The Yammer component supports 7 options, which are listed below.
+The Yammer component supports 8 options, which are listed below.
 
 
 
@@ -54,6 +54,7 @@ The Yammer component supports 7 options, which are listed below.
 | *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) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *config* (advanced) | To use a shared yammer configuration |  | YammerConfiguration
+| *requestor* (advanced) | To use a specific requester to communicate with Yammer. |  | ApiRequestor
 | *accessToken* (security) | The access token |  | String
 | *consumerKey* (security) | The consumer key |  | String
 | *consumerSecret* (security) | The consumer secret |  | String
@@ -88,7 +89,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (31 parameters):
+=== Query Parameters (32 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -108,6 +109,7 @@ with the following path and query parameters:
 | *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
 | *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) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
+| *requestor* (advanced) | To use a specific requester to communicate with Yammer. |  | ApiRequestor
 | *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
 | *backoffErrorThreshold* (scheduler) | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in. |  | int
 | *backoffIdleThreshold* (scheduler) | The number of subsequent idle polls that should happen before the backoffMultipler should kick-in. |  | int
diff --git a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerComponent.java b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerComponent.java
index ad3954d..d62994a 100644
--- a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerComponent.java
+++ b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerComponent.java
@@ -37,6 +37,8 @@ public class YammerComponent extends DefaultComponent {
     private String accessToken;
     @Metadata(label = "advanced")
     private YammerConfiguration config;
+    @Metadata(label = "advanced")
+    private ApiRequestor requestor;
     
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
@@ -50,8 +52,8 @@ public class YammerComponent extends DefaultComponent {
         endpointConfig.setConsumerKey(consumerKey);
         endpointConfig.setConsumerSecret(consumerSecret);
         endpointConfig.setAccessToken(accessToken);
-        endpointConfig.setFunction(remaining);
-        endpointConfig.setFunctionType(YammerFunctionType.fromUri(remaining));
+        endpointConfig.setFunction(YammerFunctionType.fromUri(remaining));
+        endpointConfig.setRequestor(requestor);
         
         Endpoint endpoint = new YammerEndpoint(uri, this, endpointConfig);
         setProperties(endpoint, parameters);
@@ -101,4 +103,15 @@ public class YammerComponent extends DefaultComponent {
     public void setConfig(YammerConfiguration config) {
         this.config = config;
     }
+
+    public ApiRequestor getRequestor() {
+        return requestor;
+    }
+
+    /**
+     * To use a specific requester to communicate with Yammer.
+     */
+    public void setRequestor(ApiRequestor requestor) {
+        this.requestor = requestor;
+    }
 }
diff --git a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerConfiguration.java b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerConfiguration.java
index fba38c4..0ba1f7f 100644
--- a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerConfiguration.java
+++ b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerConfiguration.java
@@ -24,9 +24,8 @@ import org.apache.camel.spi.UriPath;
 @UriParams
 public class YammerConfiguration {
 
-    @UriPath(name = "function") @Metadata(required = true)
-    private YammerFunctionType functionType;
-    private String function;
+    @UriPath @Metadata(required = true)
+    private YammerFunctionType function;
     @UriParam(label = "security") @Metadata(required = true, secret = true)
     private String consumerKey;
     @UriParam(label = "security") @Metadata(required = true, secret = true)
@@ -47,6 +46,7 @@ public class YammerConfiguration {
     private String threaded;
     @UriParam(label = "consumer")
     private String userId;
+    @UriParam(label = "advanced")
     private ApiRequestor requestor;
 
     public String getConsumerKey() {
@@ -93,25 +93,14 @@ public class YammerConfiguration {
         this.accessToken = accessToken;
     }
 
-    public YammerFunctionType getFunctionType() {
-        return functionType;
-    }
-
-    /**
-     * The function to use
-     */
-    public void setFunctionType(YammerFunctionType functionType) {
-        this.functionType = functionType;
-    }
-
-    public String getFunction() {
+    public YammerFunctionType getFunction() {
         return function;
     }
 
     /**
      * The function to use
      */
-    public void setFunction(String function) {
+    public void setFunction(YammerFunctionType function) {
         this.function = function;
     }
 
@@ -126,17 +115,6 @@ public class YammerConfiguration {
         this.useJson = useJson;
     }
 
-    public ApiRequestor getRequestor(String apiUrl) throws Exception {
-        if (requestor == null) {
-            requestor = new ScribeApiRequestor(apiUrl, getAccessToken());
-        }
-        return requestor;
-    }
-
-    public void setRequestor(ApiRequestor requestor) {
-        this.requestor = requestor;
-    }
-
     public int getLimit() {
         return limit;
     }
@@ -199,4 +177,14 @@ public class YammerConfiguration {
         this.userId = userId;
     }
 
+    public ApiRequestor getRequestor() {
+        return requestor;
+    }
+
+    /**
+     * To use a specific requester to communicate with Yammer.
+     */
+    public void setRequestor(ApiRequestor requestor) {
+        this.requestor = requestor;
+    }
 }
diff --git a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerEndpoint.java b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerEndpoint.java
index c68572f..c8b4d23 100644
--- a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerEndpoint.java
+++ b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerEndpoint.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.yammer;
 
+import org.apache.camel.Component;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
@@ -45,13 +46,18 @@ public class YammerEndpoint extends ScheduledPollEndpoint {
     }
 
     @Override
+    public YammerComponent getComponent() {
+        return (YammerComponent) super.getComponent();
+    }
+
+    @Override
     public Producer createProducer() throws Exception {
         return new YammerMessageProducer(this);
     }
 
     @Override
     public Consumer createConsumer(Processor processor) throws Exception {
-        switch (config.getFunctionType()) {
+        switch (config.getFunction()) {
             case MESSAGES:
             case ALGO:
             case FOLLOWING:
@@ -59,10 +65,14 @@ public class YammerEndpoint extends ScheduledPollEndpoint {
             case PRIVATE:
             case SENT:
             case RECEIVED:
-                return new YammerMessagePollingConsumer(this, processor);
+                YammerMessagePollingConsumer answer = new YammerMessagePollingConsumer(this, processor);
+                configureConsumer(answer);
+                return answer;
             case USERS:
             case CURRENT:
-                return new YammerUserPollingConsumer(this, processor);
+                YammerUserPollingConsumer answer2 = new YammerUserPollingConsumer(this, processor);
+                configureConsumer(answer2);
+                return answer2;
             default:
                 throw new Exception(String.format("%s is not a valid Yammer function type.", config.getFunction()));
         }
diff --git a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerMessagePollingConsumer.java b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerMessagePollingConsumer.java
index 8e2215a..774ad8c 100644
--- a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerMessagePollingConsumer.java
+++ b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerMessagePollingConsumer.java
@@ -31,6 +31,7 @@ import org.apache.camel.util.ObjectHelper;
 public class YammerMessagePollingConsumer extends ScheduledPollConsumer {
     private final YammerEndpoint endpoint;
     private final String apiUrl;
+    private ApiRequestor requestor;
 
     public YammerMessagePollingConsumer(YammerEndpoint endpoint, Processor processor) throws Exception {
         super(endpoint, processor);
@@ -45,11 +46,10 @@ public class YammerMessagePollingConsumer extends ScheduledPollConsumer {
     private String getApiUrl() throws Exception {
         StringBuilder url = new StringBuilder();
 
-        String function = endpoint.getConfig().getFunction();
-        switch (YammerFunctionType.fromUri(function)) {
+        switch (endpoint.getConfig().getFunction()) {
             case MESSAGES:
                 url.append(YammerConstants.YAMMER_BASE_API_URL);
-                url.append(function);
+                url.append(endpoint.getConfig().getFunction().name());
                 url.append(".json");
                 break;
             case ALGO:
@@ -60,11 +60,11 @@ public class YammerMessagePollingConsumer extends ScheduledPollConsumer {
             case RECEIVED:
                 url.append(YammerConstants.YAMMER_BASE_API_URL);
                 url.append("messages/");
-                url.append(function);
+                url.append(endpoint.getConfig().getFunction().name());
                 url.append(".json");
                 break;
             default:
-                throw new Exception(String.format("%s is not a valid Yammer message function type.", function));
+                throw new Exception(String.format("%s is not a valid Yammer message function type.", endpoint.getConfig().getFunction().name()));
         }
 
         StringBuilder args = new StringBuilder();
@@ -117,7 +117,7 @@ public class YammerMessagePollingConsumer extends ScheduledPollConsumer {
         Exchange exchange = endpoint.createExchange();
 
         try {
-            String jsonBody = endpoint.getConfig().getRequestor(apiUrl).get();
+            String jsonBody = requestor.get();
 
             if (!endpoint.getConfig().isUseJson()) {
                 ObjectMapper jsonMapper = new ObjectMapper();
@@ -139,5 +139,14 @@ public class YammerMessagePollingConsumer extends ScheduledPollConsumer {
         }
     }
 
-
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+        if (requestor == null) {
+            requestor = endpoint.getConfig().getRequestor();
+        }
+        if (requestor == null) {
+            requestor = new ScribeApiRequestor(apiUrl, endpoint.getConfig().getAccessToken());
+        }
+    }
 }
diff --git a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerMessageProducer.java b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerMessageProducer.java
index a66764b..424f495 100644
--- a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerMessageProducer.java
+++ b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerMessageProducer.java
@@ -27,25 +27,25 @@ public class YammerMessageProducer extends DefaultProducer {
 
     private final YammerEndpoint endpoint;
     private final String apiUrl;
+    private ApiRequestor requestor;
 
     public YammerMessageProducer(YammerEndpoint endpoint) throws Exception {
         super(endpoint);
         this.endpoint = endpoint;
-        apiUrl = getApiUrl();
+        this.apiUrl = getApiUrl();
     }
 
     private String getApiUrl() throws Exception {
         StringBuilder url = new StringBuilder();
 
-        String function = endpoint.getConfig().getFunction();
-        switch (YammerFunctionType.fromUri(function)) {
+        switch (endpoint.getConfig().getFunction()) {
             case MESSAGES:
                 url.append(YammerConstants.YAMMER_BASE_API_URL);
-                url.append(function);
+                url.append(endpoint.getConfig().getFunction().name());
                 url.append(".json");
                 break;
             default:
-                throw new Exception(String.format("%s is not a valid Yammer message producer function type.", function));
+                throw new Exception(String.format("%s is not a valid Yammer message producer function type.", endpoint.getConfig().getFunction().name()));
         }
 
         return url.toString();
@@ -55,7 +55,7 @@ public class YammerMessageProducer extends DefaultProducer {
     public void process(Exchange exchange) throws Exception {
         String body = exchange.getIn().getBody(String.class);
 
-        String jsonBody = endpoint.getConfig().getRequestor(apiUrl).post("?body=" + URLEncoder.encode(body, "UTF-8"));
+        String jsonBody = requestor.post("?body=" + URLEncoder.encode(body, "UTF-8"));
 
         // we set the body to the message that was created on the server
         if (!endpoint.getConfig().isUseJson()) {
@@ -67,4 +67,14 @@ public class YammerMessageProducer extends DefaultProducer {
         }
     }
 
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+        if (requestor == null) {
+            requestor = endpoint.getConfig().getRequestor();
+        }
+        if (requestor == null) {
+            requestor = new ScribeApiRequestor(apiUrl, endpoint.getConfig().getAccessToken());
+        }
+    }
 }
diff --git a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerUserPollingConsumer.java b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerUserPollingConsumer.java
index 63e7d8b..f4bb845 100644
--- a/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerUserPollingConsumer.java
+++ b/components/camel-yammer/src/main/java/org/apache/camel/component/yammer/YammerUserPollingConsumer.java
@@ -31,6 +31,7 @@ import org.apache.camel.support.ScheduledPollConsumer;
 public class YammerUserPollingConsumer extends ScheduledPollConsumer {
     private final YammerEndpoint endpoint;
     private final String apiUrl;
+    private ApiRequestor requestor;
 
     public YammerUserPollingConsumer(YammerEndpoint endpoint, Processor processor) throws Exception {
         super(endpoint, processor);
@@ -45,21 +46,20 @@ public class YammerUserPollingConsumer extends ScheduledPollConsumer {
     private String getApiUrl() throws Exception {
         StringBuilder url = new StringBuilder();
 
-        String function = endpoint.getConfig().getFunction();
-        switch (YammerFunctionType.fromUri(function)) {
+        switch (endpoint.getConfig().getFunction()) {
             case USERS:
                 url.append(YammerConstants.YAMMER_BASE_API_URL);
-                url.append(function);
+                url.append(endpoint.getConfig().getFunction().name());
                 url.append(".json");
                 break;
             case CURRENT:
                 url.append(YammerConstants.YAMMER_BASE_API_URL);
                 url.append("users/");
-                url.append(function);
+                url.append(endpoint.getConfig().getFunction().name());
                 url.append(".json");
                 break;
             default:
-                throw new Exception(String.format("%s is not a valid Yammer user function type.", function));
+                throw new Exception(String.format("%s is not a valid Yammer user function type.", endpoint.getConfig().getFunction().name()));
         }
 
         return url.toString();
@@ -71,12 +71,11 @@ public class YammerUserPollingConsumer extends ScheduledPollConsumer {
         Exchange exchange = endpoint.createExchange();
 
         try {
-            String jsonBody = endpoint.getConfig().getRequestor(apiUrl).get();
+            String jsonBody = requestor.get();
 
             if (!endpoint.getConfig().isUseJson()) {
                 ObjectMapper jsonMapper = new ObjectMapper();
-                String function = endpoint.getConfig().getFunction();
-                switch (YammerFunctionType.fromUri(function)) {
+                switch (endpoint.getConfig().getFunction()) {
                     case USERS:
                         List<User> users = jsonMapper.readValue(jsonBody, jsonMapper.getTypeFactory().constructCollectionType(List.class, User.class));
                         exchange.getIn().setBody(users);
@@ -86,7 +85,7 @@ public class YammerUserPollingConsumer extends ScheduledPollConsumer {
                         exchange.getIn().setBody(user);
                         break;
                     default:
-                        throw new Exception(String.format("%s is not a valid Yammer user function type.", function));
+                        throw new Exception(String.format("%s is not a valid Yammer user function type.", endpoint.getConfig().getFunction().name()));
                 }
 
             } else {
@@ -105,5 +104,15 @@ public class YammerUserPollingConsumer extends ScheduledPollConsumer {
         }
     }
 
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+        if (requestor == null) {
+            requestor = endpoint.getConfig().getRequestor();
+        }
+        if (requestor == null) {
+            requestor = new ScribeApiRequestor(apiUrl, endpoint.getConfig().getAccessToken());
+        }
+    }
 
 }
diff --git a/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerComponentTestSupport.java b/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerComponentTestSupport.java
index 23d8c09..08260d4 100644
--- a/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerComponentTestSupport.java
+++ b/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerComponentTestSupport.java
@@ -17,11 +17,9 @@
 package org.apache.camel.component.yammer;
 
 import java.io.InputStream;
-import java.util.Collection;
 
-import org.apache.camel.Endpoint;
+import org.apache.camel.CamelContext;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Before;
 
 public abstract class YammerComponentTestSupport extends CamelTestSupport {
 
@@ -32,21 +30,16 @@ public abstract class YammerComponentTestSupport extends CamelTestSupport {
     }
 
     @Override
-    @Before
-    public void setUp() throws Exception {
-        super.setUp();
-        
-        InputStream is = getClass().getResourceAsStream(jsonFile());        
-        setMessages(context.getTypeConverter().convertTo(String.class, is));    
-        
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext context = super.createCamelContext();
+
+        InputStream is = getClass().getResourceAsStream(jsonFile());
+        setMessages(context.getTypeConverter().convertTo(String.class, is));
+
         yammerComponent = context.getComponent("yammer", YammerComponent.class);
-        
-        Collection<Endpoint> endpoints = context.getEndpoints();
-        for (Endpoint endpoint : endpoints) {
-            if (endpoint instanceof YammerEndpoint) {
-                ((YammerEndpoint)endpoint).getConfig().setRequestor(new TestApiRequestor(getMessages()));
-            }
-        }
+        yammerComponent.setRequestor(new TestApiRequestor(getMessages()));
+
+        return context;
     }
 
     protected String jsonFile() {
diff --git a/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerMessageAndUserRouteTest.java b/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerMessageAndUserRouteTest.java
index 675ce73..24bcac2 100644
--- a/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerMessageAndUserRouteTest.java
+++ b/components/camel-yammer/src/test/java/org/apache/camel/component/yammer/YammerMessageAndUserRouteTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.yammer;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
@@ -31,20 +32,21 @@ public class YammerMessageAndUserRouteTest extends CamelTestSupport {
     private static final String YAMMER_MESSAGES_CONSUMER = "yammer:messages?consumerKey=aConsumerKey&consumerSecret=aConsumerSecretKey&accessToken=aAccessToken";
 
     @Override
-    @Before
-    public void setUp() throws Exception {
-        super.setUp();
-      
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext context = super.createCamelContext();
+
         YammerEndpoint messagesEndpoint = context.getEndpoint(YAMMER_MESSAGES_CONSUMER, YammerEndpoint.class);
         YammerEndpoint usersEndpoint = context.getEndpoint(YAMMER_CURRENT_USER_CONSUMER, YammerEndpoint.class);
 
         String messages = context.getTypeConverter().convertTo(String.class, getClass().getResourceAsStream("/messages.json"));
         messagesEndpoint.getConfig().setRequestor(new TestApiRequestor(messages));
-        
+
         String users = context.getTypeConverter().convertTo(String.class, getClass().getResourceAsStream("/user.json"));
         usersEndpoint.getConfig().setRequestor(new TestApiRequestor(users));
+
+        return context;
     }
-    
+
     @Test
     public void testConsumeAllMessages() throws Exception {
         MockEndpoint messagesMock = getMockEndpoint("mock:messages");
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/YammerComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/YammerComponentBuilderFactory.java
index e2ab8ba..e587515 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/YammerComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/YammerComponentBuilderFactory.java
@@ -119,6 +119,19 @@ public interface YammerComponentBuilderFactory {
             return this;
         }
         /**
+         * To use a specific requester to communicate with Yammer.
+         *
+         * The option is a:
+         * <code>org.apache.camel.component.yammer.ApiRequestor</code> type.
+         *
+         * Group: advanced
+         */
+        default YammerComponentBuilder requestor(
+                org.apache.camel.component.yammer.ApiRequestor requestor) {
+            doSetProperty("requestor", requestor);
+            return this;
+        }
+        /**
          * The access token.
          *
          * The option is a: <code>java.lang.String</code> type.
@@ -173,6 +186,7 @@ public interface YammerComponentBuilderFactory {
             case "lazyStartProducer": ((YammerComponent) component).setLazyStartProducer((boolean) value); return true;
             case "basicPropertyBinding": ((YammerComponent) component).setBasicPropertyBinding((boolean) value); return true;
             case "config": ((YammerComponent) component).setConfig((org.apache.camel.component.yammer.YammerConfiguration) value); return true;
+            case "requestor": ((YammerComponent) component).setRequestor((org.apache.camel.component.yammer.ApiRequestor) value); return true;
             case "accessToken": ((YammerComponent) component).setAccessToken((java.lang.String) value); return true;
             case "consumerKey": ((YammerComponent) component).setConsumerKey((java.lang.String) value); return true;
             case "consumerSecret": ((YammerComponent) component).setConsumerSecret((java.lang.String) value); return true;