This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch athena-aws2 in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 23d7705436d078fcf3bf8ae99b416431c06820a0 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Tue Jun 23 09:19:07 2020 +0200 Added an AWS2-Athena native extension --- .../modules/ROOT/pages/extensions/aws2-athena.adoc | 34 +++++++ .../pages/list-of-camel-quarkus-extensions.adoc | 4 +- extensions/aws2-athena/deployment/pom.xml | 87 +++++++++++++++++ .../athena/deployment/Aws2AthenaProcessor.java | 66 +++++++++++++ extensions/aws2-athena/pom.xml | 39 ++++++++ extensions/aws2-athena/runtime/pom.xml | 106 +++++++++++++++++++++ .../main/resources/META-INF/quarkus-extension.yaml | 29 ++++++ extensions/pom.xml | 1 + integration-tests/aws2/pom.xml | 4 + .../camel/quarkus/component/aws2/CamelRoute.java | 4 + .../aws2/src/main/resources/application.properties | 4 + poms/bom-deployment/pom.xml | 5 + poms/bom/pom.xml | 16 ++++ 13 files changed, 398 insertions(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/extensions/aws2-athena.adoc b/docs/modules/ROOT/pages/extensions/aws2-athena.adoc new file mode 100644 index 0000000..1776c9c --- /dev/null +++ b/docs/modules/ROOT/pages/extensions/aws2-athena.adoc @@ -0,0 +1,34 @@ +// Do not edit directly! +// This file was generated by camel-quarkus-package-maven-plugin:update-extension-doc-page + +[[aws2-athena]] += AWS 2 Athena + +[.badges] +[.badge-key]##Since Camel Quarkus##[.badge-version]##1.0.0-CR3## [.badge-key]##JVM##[.badge-supported]##supported## [.badge-key]##Native##[.badge-supported]##supported## + +Access AWS Athena service using AWS SDK version 2.x. + +== What's inside + +* https://camel.apache.org/components/latest/aws2-athena-component.html[AWS 2 Athena component], URI syntax: `aws2-athena:label` + +Please refer to the above link for usage and configuration details. + +== Maven coordinates + +[source,xml] +---- +<dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws2-athena</artifactId> +</dependency> +---- + +Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications. + +== SSL in native mode + +This extension auto-enables SSL support in native mode. Hence you do not need to add +`quarkus.ssl.native=true` to your `application.properties` yourself. See also +https://quarkus.io/guides/native-and-ssl[Quarkus SSL guide]. 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 b911fa9..46e27c6 100644 --- a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc +++ b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc @@ -18,7 +18,7 @@ In case you are missing some Camel feature in the list: == Camel Components // components: START -Number of Camel components: 150 in 115 JAR artifacts (0 deprecated) +Number of Camel components: 151 in 116 JAR artifacts (0 deprecated) [width="100%",cols="4,1,1,1,5",options="header"] |=== @@ -34,6 +34,8 @@ Number of Camel components: 150 in 115 JAR artifacts (0 deprecated) | xref:extensions/avro-rpc.adoc[Avro RPC] | camel-quarkus-avro-rpc | JVM + Preview | 1.0.0-M6 | Produce or consume Apache Avro RPC services. +| xref:extensions/aws2-athena.adoc[AWS 2 Athena] | camel-quarkus-aws2-athena | Native + Stable | 1.0.0-CR3 | Access AWS Athena service using AWS SDK version 2.x. + | xref:extensions/aws2-cw.adoc[AWS 2 CloudWatch] | camel-quarkus-aws2-cw | Native + Stable | 1.0.0-M6 | Sending metrics to AWS CloudWatch using AWS SDK version 2.x. | xref:extensions/aws2-ddb.adoc[AWS 2 DynamoDB] | camel-quarkus-aws2-ddb | Native + Stable | 1.0.0-M6 | Store and retrieve data from AWS DynamoDB service using AWS SDK version 2.x. diff --git a/extensions/aws2-athena/deployment/pom.xml b/extensions/aws2-athena/deployment/pom.xml new file mode 100644 index 0000000..5bd30b2 --- /dev/null +++ b/extensions/aws2-athena/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-aws2-athena-parent</artifactId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-aws2-athena-deployment</artifactId> + <name>Camel Quarkus :: AWS 2 Athena :: 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-aws2-athena</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-aws2-deployment</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/aws2-athena/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/athena/deployment/Aws2AthenaProcessor.java b/extensions/aws2-athena/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/athena/deployment/Aws2AthenaProcessor.java new file mode 100644 index 0000000..50ebf98 --- /dev/null +++ b/extensions/aws2-athena/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/athena/deployment/Aws2AthenaProcessor.java @@ -0,0 +1,66 @@ +/* + * 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.aws2.athena.deployment; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; +import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; +import org.jboss.jandex.DotName; +import software.amazon.awssdk.core.interceptor.ExecutionInterceptor; + +class Aws2AthenaProcessor { + + private static final String FEATURE = "camel-aws2-athena"; + + public static final String AWS_SDK_APPLICATION_ARCHIVE_MARKERS = "software/amazon/awssdk"; + + private static final List<String> INTERCEPTOR_PATHS = Arrays.asList( + "software/amazon/awssdk/global/handlers/execution.interceptors"); + + private static final DotName EXECUTION_INTERCEPTOR_NAME = DotName.createSimple(ExecutionInterceptor.class.getName()); + + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } + + @BuildStep(applicationArchiveMarkers = { AWS_SDK_APPLICATION_ARCHIVE_MARKERS }) + void process(CombinedIndexBuildItem combinedIndexBuildItem, + BuildProducer<ReflectiveClassBuildItem> reflectiveClasses, + BuildProducer<NativeImageResourceBuildItem> resource) { + + INTERCEPTOR_PATHS.forEach(path -> resource.produce(new NativeImageResourceBuildItem(path))); + + List<String> knownInterceptorImpls = combinedIndexBuildItem.getIndex() + .getAllKnownImplementors(EXECUTION_INTERCEPTOR_NAME) + .stream() + .map(c -> c.name().toString()).collect(Collectors.toList()); + + reflectiveClasses.produce(new ReflectiveClassBuildItem(false, false, + knownInterceptorImpls.toArray(new String[knownInterceptorImpls.size()]))); + + reflectiveClasses.produce(new ReflectiveClassBuildItem(true, false, + String.class.getCanonicalName())); + } +} diff --git a/extensions/aws2-athena/pom.xml b/extensions/aws2-athena/pom.xml new file mode 100644 index 0000000..3f34aa0 --- /dev/null +++ b/extensions/aws2-athena/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-aws2-athena-parent</artifactId> + <name>Camel Quarkus :: AWS 2 Athena</name> + <packaging>pom</packaging> + + <modules> + <module>deployment</module> + <module>runtime</module> + </modules> +</project> diff --git a/extensions/aws2-athena/runtime/pom.xml b/extensions/aws2-athena/runtime/pom.xml new file mode 100644 index 0000000..aba16d0 --- /dev/null +++ b/extensions/aws2-athena/runtime/pom.xml @@ -0,0 +1,106 @@ +<?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-aws2-athena-parent</artifactId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-aws2-athena</artifactId> + <name>Camel Quarkus :: AWS 2 Athena :: Runtime</name> + <description>Access AWS Athena service using AWS SDK version 2.x.</description> + + <properties> + <firstVersion>1.0.0-CR3</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</groupId> + <artifactId>camel-aws2-athena</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-support-aws2</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> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-package-maven-plugin</artifactId> + <executions> + <execution> + <id>update-extension-doc-page</id> + <goals><goal>update-extension-doc-page</goal></goals> + <phase>process-classes</phase> + </execution> + </executions> + </plugin> + <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/aws2-athena/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/aws2-athena/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000..0bc1b57 --- /dev/null +++ b/extensions/aws2-athena/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,29 @@ +# +# 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. +# + +# This is a generated file. Do not edit directly! +# To re-generate, run the following command from the top level directory: +# +# mvn -N cq:update-quarkus-metadata +# +--- +name: "Camel AWS 2 Athena" +description: "Access AWS Athena service using AWS SDK version 2.x" +metadata: + guide: "https://camel.apache.org/components/latest/aws2-athena-component.html" + categories: + - "integration" diff --git a/extensions/pom.xml b/extensions/pom.xml index 78099ce..2d24ee0 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -52,6 +52,7 @@ <module>aws-sqs</module> <module>aws-swf</module> <module>aws-translate</module> + <module>aws2-athena</module> <module>aws2-cw</module> <module>aws2-ddb</module> <module>aws2-ec2</module> diff --git a/integration-tests/aws2/pom.xml b/integration-tests/aws2/pom.xml index dc31bbb..aa49fad 100644 --- a/integration-tests/aws2/pom.xml +++ b/integration-tests/aws2/pom.xml @@ -46,6 +46,10 @@ </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws2-athena</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws2-ddb</artifactId> </dependency> <dependency> diff --git a/integration-tests/aws2/src/main/java/org/apache/camel/quarkus/component/aws2/CamelRoute.java b/integration-tests/aws2/src/main/java/org/apache/camel/quarkus/component/aws2/CamelRoute.java index 21667db..d4ef366 100644 --- a/integration-tests/aws2/src/main/java/org/apache/camel/quarkus/component/aws2/CamelRoute.java +++ b/integration-tests/aws2/src/main/java/org/apache/camel/quarkus/component/aws2/CamelRoute.java @@ -85,6 +85,10 @@ public class CamelRoute extends RouteBuilder { from("timer:quarkus-msk?repeatCount=1") .to("aws2-msk://cluster?operation=listClusters") .to("log:sf?showAll=true"); + + from("timer:quarkus-athena?repeatCount=1") + .to("aws2-athena://cluster?operation=listQueryExecutions") + .to("log:sf?showAll=true"); } } diff --git a/integration-tests/aws2/src/main/resources/application.properties b/integration-tests/aws2/src/main/resources/application.properties index 7c2f77b..b64ebc0 100644 --- a/integration-tests/aws2/src/main/resources/application.properties +++ b/integration-tests/aws2/src/main/resources/application.properties @@ -65,3 +65,7 @@ camel.component.aws2-msk.region={{env:AWS_REGION}} camel.component.aws2-mq.access-key={{env:AWS_ACCESS_KEY}} camel.component.aws2-mq.secret-key={{env:AWS_SECRET_KEY}} camel.component.aws2-mq.region={{env:AWS_REGION}} + +camel.component.aws2-athena.access-key={{env:AWS_ACCESS_KEY}} +camel.component.aws2-athena.secret-key={{env:AWS_SECRET_KEY}} +camel.component.aws2-athena.region={{env:AWS_REGION}} diff --git a/poms/bom-deployment/pom.xml b/poms/bom-deployment/pom.xml index 3420681..093dbd5 100644 --- a/poms/bom-deployment/pom.xml +++ b/poms/bom-deployment/pom.xml @@ -169,6 +169,11 @@ </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws2-athena-deployment</artifactId> + <version>${camel-quarkus.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws2-cw-deployment</artifactId> <version>${camel-quarkus.version}</version> </dependency> diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml index 5cb9e30..06fe7dc 100644 --- a/poms/bom/pom.xml +++ b/poms/bom/pom.xml @@ -218,6 +218,17 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-aws2-athena</artifactId> + <version>${camel.version}</version> + <exclusions> + <exclusion> + <groupId>software.amazon.awssdk</groupId> + <artifactId>netty-nio-client</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-aws2-cw</artifactId> <version>${camel.version}</version> <exclusions> @@ -1290,6 +1301,11 @@ </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws2-athena</artifactId> + <version>${camel-quarkus.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws2-cw</artifactId> <version>${camel-quarkus.version}</version> </dependency>