You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2017/01/19 09:21:29 UTC

[1/4] camel git commit: CAMEL-10723: Improved camel-aws kinesis documentation

Repository: camel
Updated Branches:
  refs/heads/master 9b2f2989b -> 8392379c3


CAMEL-10723: Improved camel-aws kinesis documentation


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4d9ea2e8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4d9ea2e8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4d9ea2e8

Branch: refs/heads/master
Commit: 4d9ea2e867c836e302c416446bb6fb54aaf761d7
Parents: 9b2f298
Author: Pontus Ullgren <po...@redpill-linpro.com>
Authored: Wed Jan 18 15:02:28 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jan 19 10:10:48 2017 +0100

----------------------------------------------------------------------
 .../src/main/docs/aws-kinesis-component.adoc          | 14 +++++++++++---
 .../camel/component/aws/kinesis/KinesisEndpoint.java  |  4 ++--
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4d9ea2e8/components/camel-aws/src/main/docs/aws-kinesis-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/docs/aws-kinesis-component.adoc b/components/camel-aws/src/main/docs/aws-kinesis-component.adoc
index 6a59c3b..328831b 100644
--- a/components/camel-aws/src/main/docs/aws-kinesis-component.adoc
+++ b/components/camel-aws/src/main/docs/aws-kinesis-component.adoc
@@ -2,7 +2,7 @@
 
 *Available as of Camel 2.17*
 
-The Kinesis component supports receiving messages from Amazon Kinesis
+The Kinesis component supports receiving messages from and sending messages to Amazon Kinesis
 service.
 
 Prerequisites
@@ -108,7 +108,7 @@ size is not defined by the API. If it is to be used as a numerical type then use
 
 #### AmazonKinesis configuration
 
-You will need to create an instance of AmazonDynamoDBStreamsClient and
+You will need to create an instance of AmazonKinesisClient and
 bind it to the registry
 
 [source,java]
@@ -118,12 +118,20 @@ clientConfiguration.setProxyHost("http://myProxyHost");
 clientConfiguration.setProxyPort(8080);
 
 Region region = Region.getRegion(Regions.fromName(region));
-region.createClient(AmazonDynamoDBStreamsClient.class, null, clientConfiguration);
+region.createClient(AmazonKinesisClient.class, null, clientConfiguration);
 // the 'null' here is the AWSCredentialsProvider which defaults to an instance of DefaultAWSCredentialsProviderChain
 
 registry.bind("kinesisClient", client);
 --------------------------------------------------------------------------------------------------------------------
 
+You then have to reference the AmazonKinesisClient in the `amazonKinesisClient` URI option.
+
+[source,java]
+--------------------------------------------------------------------------------------------------------------------
+from("aws-kinesis://mykinesisstream?amazonKinesisClient=#kinesisClient")
+  .to("log:out?showAll=true");
+--------------------------------------------------------------------------------------------------------------------
+
 #### Providing AWS Credentials
 
 It is recommended that the credentials are obtained by using the

http://git-wip-us.apache.org/repos/asf/camel/blob/4d9ea2e8/components/camel-aws/src/main/java/org/apache/camel/component/aws/kinesis/KinesisEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/kinesis/KinesisEndpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/kinesis/KinesisEndpoint.java
index 833a230..2568c98 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/kinesis/KinesisEndpoint.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/kinesis/KinesisEndpoint.java
@@ -43,11 +43,11 @@ public class KinesisEndpoint extends ScheduledPollEndpoint {
     private AmazonKinesis amazonKinesisClient;
     @UriParam(label = "consumer", description = "Maximum number of records that will be fetched in each poll", defaultValue = "1")
     private int maxResultsPerRequest = 1;
-    @UriParam(label = "consumer", description = "Defines where in the Kinesis stream to start getting records")
+    @UriParam(label = "consumer", description = "Defines where in the Kinesis stream to start getting records", defaultValue = "TRIM_HORIZON")
     private ShardIteratorType iteratorType = ShardIteratorType.TRIM_HORIZON;
     @UriParam(label = "consumer", description = "Defines which shardId in the Kinesis stream to get records from")
     private String shardId = "";
-    @UriParam(label = "consumer", description = "The sequence number to start polling from")
+    @UriParam(label = "consumer", description = "The sequence number to start polling from. Required if iteratorType is set to AFTER_SEQUENCE_NUMBER or AT_SEQUENCE_NUMBER")
     private String sequenceNumber = "";
 
     public KinesisEndpoint(String uri, String streamName, KinesisComponent component) {


[4/4] camel git commit: CAMEL-9945 Upgrade to jetty 9.3

Posted by ac...@apache.org.
CAMEL-9945 Upgrade to jetty 9.3

Java compiler uses the actual return type of the method in the compiled
class and as the signature of
`org.eclipse.jetty.client.HttpClient::getProtocolHandlers` method
changed between Jetty 9.2 and 9.3 in return type it could be compiled
and run against both versions, but it could not be compiled with one
version and run against another.

This commit uses reflection when calling `getProtocolHandlers` method to
maintain compatibility with 9.2 and 9.3 versions of Jetty regardless of
compile time vs runtime version.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8392379c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8392379c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8392379c

Branch: refs/heads/master
Commit: 8392379c320aa6de48acf0a07105c70148487ff8
Parents: ca624ee
Author: Zoran Regvart <zo...@regvart.com>
Authored: Wed Jan 18 14:54:00 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jan 19 10:19:53 2017 +0100

----------------------------------------------------------------------
 .../camel/component/salesforce/SalesforceHttpClient.java       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8392379c/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceHttpClient.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceHttpClient.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceHttpClient.java
index 95095aa..68187c3 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceHttpClient.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceHttpClient.java
@@ -52,6 +52,8 @@ public class SalesforceHttpClient extends HttpClient {
 
     private final Method addSecuirtyHandlerMethod;
 
+    private final Method getProtocolHandlersMethod;
+
     public SalesforceHttpClient() {
         this(null);
     }
@@ -75,6 +77,8 @@ public class SalesforceHttpClient extends HttpClient {
             } else {
                 addSecuirtyHandlerMethod = getProtocolHandlersType.getMethod("put", ProtocolHandler.class);
             }
+
+            getProtocolHandlersMethod = HttpClient.class.getMethod("getProtocolHandlers");
         } catch (NoSuchMethodException e) {
             throw new IllegalStateException("Found no method of adding SalesforceSecurityHandler as ProtocolHandler to Jetty HttpClient. You need Jetty 9.2 or newer on the classpath.");
         }
@@ -99,7 +103,7 @@ public class SalesforceHttpClient extends HttpClient {
         }
 
         // compensate for Jetty 9.2 vs 9.3 API change
-        final Object protocolHandlers = getProtocolHandlers();
+        final Object protocolHandlers = getProtocolHandlersMethod.invoke(this);
         addSecuirtyHandlerMethod.invoke(protocolHandlers, new SalesforceSecurityHandler(this));
 
         super.doStart();


[2/4] camel git commit: Fix invalid endpoint config in IrcsListUsersIntegrationTest

Posted by ac...@apache.org.
Fix invalid endpoint config in IrcsListUsersIntegrationTest


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7280b0a4
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7280b0a4
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7280b0a4

Branch: refs/heads/master
Commit: 7280b0a45dbe3d6b4aedfedb393d4092b3e25d53
Parents: 4d9ea2e
Author: James Netherton <ja...@gmail.com>
Authored: Wed Jan 18 20:12:43 2017 +0000
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jan 19 10:11:18 2017 +0100

----------------------------------------------------------------------
 components/camel-irc/src/main/docs/irc-component.adoc            | 4 ++--
 .../apache/camel/component/irc/IrcsListUsersIntegrationTest.java | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7280b0a4/components/camel-irc/src/main/docs/irc-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-irc/src/main/docs/irc-component.adoc b/components/camel-irc/src/main/docs/irc-component.adoc
index af4a499..0cc8a22 100644
--- a/components/camel-irc/src/main/docs/irc-component.adoc
+++ b/components/camel-irc/src/main/docs/irc-component.adoc
@@ -179,7 +179,7 @@ For example we want to get all exchanges that contain the usernames of the chann
 
 [source,java]
 -----------------------------------------------------------------------------
-from("ircs:nick@myserver:1234/#mychannelname?listOnJoin=true&onReply=true")
+from("ircs:nick@myserver:1234/#mychannelname?namesOnJoin=true&onReply=true")
 	.choice()
 		.when(header("irc.messageType").isEqualToIgnoreCase("REPLY"))
 			.filter(header("irc.num").isEqualTo("353"))
@@ -191,4 +191,4 @@ from("ircs:nick@myserver:1234/#mychannelname?listOnJoin=true&onReply=true")
 * link:configuring-camel.html[Configuring Camel]
 * link:component.html[Component]
 * link:endpoint.html[Endpoint]
-* link:getting-started.html[Getting Started]
\ No newline at end of file
+* link:getting-started.html[Getting Started]

http://git-wip-us.apache.org/repos/asf/camel/blob/7280b0a4/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcsListUsersIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcsListUsersIntegrationTest.java b/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcsListUsersIntegrationTest.java
index fc3241d..7e629ee 100644
--- a/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcsListUsersIntegrationTest.java
+++ b/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcsListUsersIntegrationTest.java
@@ -65,7 +65,7 @@ public class IrcsListUsersIntegrationTest extends CamelTestSupport {
             public void configure() throws Exception {
                 LOGGER.debug("Creating new test route");
                 
-                from(PRODUCER_URI + "?listOnJoin=true&onReply=true")
+                from(PRODUCER_URI + "?namesOnJoin=true&onReply=true")
                     .choice()
                         .when(header("irc.messageType").isEqualToIgnoreCase("REPLY"))
                             .filter(header("irc.num").isEqualTo(IRC_RPL_NAMREPLY))


[3/4] camel git commit: Regen docs

Posted by ac...@apache.org.
Regen docs


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ca624ee6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ca624ee6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ca624ee6

Branch: refs/heads/master
Commit: ca624ee6adfbf586abbcf320b2c8c58b0baf4f4f
Parents: 7280b0a
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jan 19 10:16:07 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jan 19 10:16:07 2017 +0100

----------------------------------------------------------------------
 components/camel-aws/src/main/docs/aws-kinesis-component.adoc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ca624ee6/components/camel-aws/src/main/docs/aws-kinesis-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/docs/aws-kinesis-component.adoc b/components/camel-aws/src/main/docs/aws-kinesis-component.adoc
index 328831b..10c56d9 100644
--- a/components/camel-aws/src/main/docs/aws-kinesis-component.adoc
+++ b/components/camel-aws/src/main/docs/aws-kinesis-component.adoc
@@ -45,10 +45,10 @@ The AWS Kinesis component supports 25 endpoint options which are listed below:
 | streamName | common |  | String | *Required* Name of the stream
 | amazonKinesisClient | common |  | AmazonKinesis | *Required* Amazon Kinesis client to use for all requests for this endpoint
 | bridgeErrorHandler | consumer | false | boolean | 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.
-| iteratorType | consumer |  | ShardIteratorType | Defines where in the Kinesis stream to start getting records
+| iteratorType | consumer | TRIM_HORIZON | ShardIteratorType | Defines where in the Kinesis stream to start getting records
 | maxResultsPerRequest | consumer | 1 | int | Maximum number of records that will be fetched in each poll
 | sendEmptyMessageWhenIdle | consumer | false | boolean | If the polling consumer did not poll any files you can enable this option to send an empty message (no body) instead.
-| sequenceNumber | consumer |  | String | The sequence number to start polling from
+| sequenceNumber | consumer |  | String | The sequence number to start polling from. Required if iteratorType is set to AFTER_SEQUENCE_NUMBER or AT_SEQUENCE_NUMBER
 | shardId | consumer |  | String | Defines which shardId in the Kinesis stream to get records from
 | exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN or ERROR level and ignored.
 | exchangePattern | consumer (advanced) |  | ExchangePattern | Sets the exchange pattern when the consumer creates an exchange.
@@ -192,4 +192,4 @@ where `${camel-version`} must be replaced by the actual version of Camel
 * link:endpoint.html[Endpoint]
 * link:getting-started.html[Getting Started]
 
-* link:aws.html[AWS Component]
\ No newline at end of file
+* link:aws.html[AWS Component]