This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch aws-kinesis in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 55b204dc4a5ee35e860309e6be9b09757c5fb210 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Thu Jan 16 10:10:38 2020 +0100 Added an AWS Kinesis extension --- .../pages/list-of-camel-quarkus-extensions.adoc | 8 +- extensions/aws-kinesis/deployment/pom.xml | 87 +++++++++++++++++ .../kinesis/deployment/AwsKinesisProcessor.java | 69 +++++++++++++ extensions/aws-kinesis/pom.xml | 39 ++++++++ extensions/aws-kinesis/runtime/pom.xml | 108 +++++++++++++++++++++ .../main/resources/META-INF/quarkus-extension.yaml | 28 ++++++ extensions/pom.xml | 1 + extensions/readme.adoc | 8 +- integration-tests/aws/pom.xml | 4 + .../camel/quarkus/component/aws/CamelRoute.java | 3 + .../aws/src/main/resources/application.properties | 16 ++- poms/bom-deployment/pom.xml | 5 + poms/bom/pom.xml | 10 ++ 13 files changed, 383 insertions(+), 3 deletions(-) diff --git a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc index 012169d..fba28ec 100644 --- a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc +++ b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc @@ -6,7 +6,7 @@ As of Camel Quarkus {camel-quarkus-last-release} the following Camel artifacts a == Camel Components // components: START -Number of Camel components: 57 in 49 JAR artifacts (0 deprecated) +Number of Camel components: 59 in 50 JAR artifacts (0 deprecated) [width="100%",cols="4,1,5",options="header"] |=== @@ -27,6 +27,12 @@ Number of Camel components: 57 in 49 JAR artifacts (0 deprecated) | link:https://camel.apache.org/components/latest/aws-iam-component.html[AWS IAM] (camel-quarkus-aws-iam) + `aws-iam:label` | 1.1.0 | The aws-iam is used for managing Amazon IAM +| link:https://camel.apache.org/components/latest/aws-kinesis-component.html[AWS Kinesis] (camel-quarkus-aws-kinesis) + +`aws-kinesis:streamName` | 1.2.0 | The aws-kinesis component is for consuming and producing records from Amazon Kinesis Streams. + +| link:https://camel.apache.org/components/latest/aws-kinesis-firehose-component.html[AWS Kinesis Firehose] (camel-quarkus-aws-kinesis) + +`aws-kinesis-firehose:streamName` | 1.2.0 | The aws-kinesis-firehose component is used for producing Amazon's Kinesis Firehose streams. + | link:https://camel.apache.org/components/latest/aws-kms-component.html[AWS KMS] (camel-quarkus-aws-kms) + `aws-kms:label` | 1.0.0-M1 | The aws-kms is used for managing Amazon KMS diff --git a/extensions/aws-kinesis/deployment/pom.xml b/extensions/aws-kinesis/deployment/pom.xml new file mode 100644 index 0000000..924a9b8 --- /dev/null +++ b/extensions/aws-kinesis/deployment/pom.xml @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws-kinesis-parent</artifactId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-aws-kinesis-deployment</artifactId> + <name>Camel Quarkus :: AWS Kinesis :: Deployment</name> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bom-deployment</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-core-deployment</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-support-xml-deployment</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-support-commons-logging-deployment</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-support-aws-deployment</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws-kinesis</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <annotationProcessorPaths> + <path> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-extension-processor</artifactId> + <version>${quarkus.version}</version> + </path> + </annotationProcessorPaths> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/extensions/aws-kinesis/deployment/src/main/java/org/apache/camel/quarkus/component/aws/kinesis/deployment/AwsKinesisProcessor.java b/extensions/aws-kinesis/deployment/src/main/java/org/apache/camel/quarkus/component/aws/kinesis/deployment/AwsKinesisProcessor.java new file mode 100644 index 0000000..cf2052c --- /dev/null +++ b/extensions/aws-kinesis/deployment/src/main/java/org/apache/camel/quarkus/component/aws/kinesis/deployment/AwsKinesisProcessor.java @@ -0,0 +1,69 @@ +/* + * 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.quarkus.component.aws.kinesis.deployment; + +import org.apache.camel.component.aws.firehose.KinesisFirehoseConfiguration; +import org.apache.camel.component.aws.kinesis.KinesisConfiguration; + +import com.amazonaws.partitions.model.CredentialScope; +import com.amazonaws.partitions.model.Endpoint; +import com.amazonaws.partitions.model.Partition; +import com.amazonaws.partitions.model.Partitions; +import com.amazonaws.partitions.model.Region; +import com.amazonaws.partitions.model.Service; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; +import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem; +import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; + +class AwsKinesisProcessor { + + public static final String AWS_KINESIS_APPLICATION_ARCHIVE_MARKERS = "com/amazonaws"; + + private static final String FEATURE = "camel-aws-kinesis"; + + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } + + @BuildStep + ExtensionSslNativeSupportBuildItem activateSslNativeSupport() { + return new ExtensionSslNativeSupportBuildItem(FEATURE); + } + + @BuildStep(applicationArchiveMarkers = { AWS_KINESIS_APPLICATION_ARCHIVE_MARKERS }) + void process(CombinedIndexBuildItem combinedIndexBuildItem, + BuildProducer<ReflectiveClassBuildItem> reflectiveClass, + BuildProducer<NativeImageResourceBuildItem> resource) { + + resource.produce(new NativeImageResourceBuildItem("com/amazonaws/partitions/endpoints.json")); + reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, + Partitions.class.getCanonicalName(), + Partition.class.getCanonicalName(), + Endpoint.class.getCanonicalName(), + Region.class.getCanonicalName(), + Service.class.getCanonicalName(), + CredentialScope.class.getCanonicalName(), + KinesisConfiguration.class.getCanonicalName(), + KinesisFirehoseConfiguration.class.getCanonicalName())); + } +} diff --git a/extensions/aws-kinesis/pom.xml b/extensions/aws-kinesis/pom.xml new file mode 100644 index 0000000..60ccc3c --- /dev/null +++ b/extensions/aws-kinesis/pom.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-build-parent</artifactId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../../poms/build-parent/pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-aws-kinesis-parent</artifactId> + <name>Camel Quarkus :: AWS Kinesis</name> + <packaging>pom</packaging> + + <modules> + <module>deployment</module> + <module>runtime</module> + </modules> +</project> diff --git a/extensions/aws-kinesis/runtime/pom.xml b/extensions/aws-kinesis/runtime/pom.xml new file mode 100644 index 0000000..b03b463 --- /dev/null +++ b/extensions/aws-kinesis/runtime/pom.xml @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws-kinesis-parent</artifactId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-aws-kinesis</artifactId> + <name>Camel Quarkus :: AWS Kinesis :: Runtime</name> + + <properties> + <firstVersion>1.2.0</firstVersion> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bom</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-support-aws</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-support-xml</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-support-commons-logging</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-aws-kinesis</artifactId> + <exclusions> + <exclusion> + <groupId>com.fasterxml.jackson.dataformat</groupId> + <artifactId>jackson-dataformat-cbor</artifactId> + </exclusion> + <exclusion> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-bootstrap-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <annotationProcessorPaths> + <path> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-extension-processor</artifactId> + <version>${quarkus.version}</version> + </path> + </annotationProcessorPaths> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/extensions/aws-kinesis/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/aws-kinesis/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000..82af3ed --- /dev/null +++ b/extensions/aws-kinesis/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,28 @@ +# +# 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. +# + +--- +name: "Camel Quarkus AWS Kinesis" +description: "A Camel Amazon Kinesis Web Service Component" +metadata: + keywords: + - "camel" + - "aws" + - "cloud" + guide: "https://quarkus.io/guides/camel" + categories: + - "integration" diff --git a/extensions/pom.xml b/extensions/pom.xml index aa6e18e..e735f93 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -49,6 +49,7 @@ <module>aws-ecs</module> <module>aws-eks</module> <module>aws-iam</module> + <module>aws-kinesis</module> <module>aws-kms</module> <module>aws-lambda</module> <module>aws-s3</module> diff --git a/extensions/readme.adoc b/extensions/readme.adoc index f8ca437..4567fbf 100644 --- a/extensions/readme.adoc +++ b/extensions/readme.adoc @@ -5,7 +5,7 @@ Apache Camel Quarkus supports the following Camel artifacts as Quarkus Extension == Camel Components // components: START -Number of Camel components: 57 in 49 JAR artifacts (0 deprecated) +Number of Camel components: 59 in 50 JAR artifacts (0 deprecated) [width="100%",cols="4,1,5",options="header"] |=== @@ -26,6 +26,12 @@ Number of Camel components: 57 in 49 JAR artifacts (0 deprecated) | link:https://camel.apache.org/components/latest/aws-iam-component.html[AWS IAM] (camel-quarkus-aws-iam) + `aws-iam:label` | 1.1.0 | The aws-iam is used for managing Amazon IAM +| link:https://camel.apache.org/components/latest/aws-kinesis-component.html[AWS Kinesis] (camel-quarkus-aws-kinesis) + +`aws-kinesis:streamName` | 1.2.0 | The aws-kinesis component is for consuming and producing records from Amazon Kinesis Streams. + +| link:https://camel.apache.org/components/latest/aws-kinesis-firehose-component.html[AWS Kinesis Firehose] (camel-quarkus-aws-kinesis) + +`aws-kinesis-firehose:streamName` | 1.2.0 | The aws-kinesis-firehose component is used for producing Amazon's Kinesis Firehose streams. + | link:https://camel.apache.org/components/latest/aws-kms-component.html[AWS KMS] (camel-quarkus-aws-kms) + `aws-kms:label` | 1.0.0-M1 | The aws-kms is used for managing Amazon KMS diff --git a/integration-tests/aws/pom.xml b/integration-tests/aws/pom.xml index f58b256..ed6e34c 100644 --- a/integration-tests/aws/pom.xml +++ b/integration-tests/aws/pom.xml @@ -68,6 +68,10 @@ </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws-kinesis</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws-translate</artifactId> </dependency> <dependency> diff --git a/integration-tests/aws/src/main/java/org/apache/camel/quarkus/component/aws/CamelRoute.java b/integration-tests/aws/src/main/java/org/apache/camel/quarkus/component/aws/CamelRoute.java index 0fe5403..683fada 100644 --- a/integration-tests/aws/src/main/java/org/apache/camel/quarkus/component/aws/CamelRoute.java +++ b/integration-tests/aws/src/main/java/org/apache/camel/quarkus/component/aws/CamelRoute.java @@ -74,6 +74,9 @@ public class CamelRoute extends RouteBuilder { .setBody(constant("Ciao")) .to("aws-translate://cluster?operation=translateText") .log("Translation: ${body}"); + + from("aws-kinesis://mykinesisstream") + .to("log:sf?showAll=true"); } } diff --git a/integration-tests/aws/src/main/resources/application.properties b/integration-tests/aws/src/main/resources/application.properties index 2b5441c..ab29175 100644 --- a/integration-tests/aws/src/main/resources/application.properties +++ b/integration-tests/aws/src/main/resources/application.properties @@ -93,4 +93,18 @@ camel.component.aws-lambda.region={{env:AWS_REGION}} # camel.component.aws-translate.access-key={{env:AWS_ACCESS_KEY}} camel.component.aws-translate.secret-key={{env:AWS_SECRET_KEY}} -camel.component.aws-translate.region={{env:AWS_REGION}} \ No newline at end of file +camel.component.aws-translate.region={{env:AWS_REGION}} + +# +# Camel :: AWS Kinesis +# +camel.component.aws-kinesis.access-key={{env:AWS_ACCESS_KEY}} +camel.component.aws-kinesis.secret-key={{env:AWS_SECRET_KEY}} +camel.component.aws-kinesis.region={{env:AWS_REGION}} + +# +# Camel :: AWS Kinesis Firehose +# +camel.component.aws-kinesis-firehose.access-key={{env:AWS_ACCESS_KEY}} +camel.component.aws-kinesis-firehose.secret-key={{env:AWS_SECRET_KEY}} +camel.component.aws-kinesis-firehose.region={{env:AWS_REGION}} \ No newline at end of file diff --git a/poms/bom-deployment/pom.xml b/poms/bom-deployment/pom.xml index f03beb3..43d0778 100644 --- a/poms/bom-deployment/pom.xml +++ b/poms/bom-deployment/pom.xml @@ -91,6 +91,11 @@ </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws-kinesis-deployment</artifactId> + <version>${camel-quarkus.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws-kms-deployment</artifactId> <version>${camel-quarkus.version}</version> </dependency> diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml index 38b02a0..3d74775 100644 --- a/poms/bom/pom.xml +++ b/poms/bom/pom.xml @@ -98,6 +98,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-aws-kinesis</artifactId> + <version>${camel.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-aws-kms</artifactId> <version>${camel.version}</version> </dependency> @@ -520,6 +525,11 @@ </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws-kinesis</artifactId> + <version>${camel-quarkus.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws-kms</artifactId> <version>${camel-quarkus.version}</version> </dependency>