This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch aws2-ses in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit aee8f89e8c4db2e77a1d101a3eba79e09f6fc019 Author: Andrea Cosentino <[email protected]> AuthorDate: Mon Jun 22 09:27:15 2020 +0200 Added an AWS2-SES native extension --- docs/modules/ROOT/pages/extensions/aws2-ses.adoc | 8 ++- .../pages/list-of-camel-quarkus-extensions.adoc | 2 +- .../aws2/ses/deployment/Aws2SesProcessor.java | 47 --------------- extensions-jvm/pom.xml | 1 - .../aws2-ses/deployment/pom.xml | 12 ++++ .../aws2/ses/deployment/Aws2SesProcessor.java | 66 ++++++++++++++++++++++ .../aws2-ses/integration-test/pom.xml | 0 .../component/aws2/ses/it/Aws2SesResource.java | 0 .../quarkus/component/aws2/ses/it/Aws2SesTest.java | 0 {extensions-jvm => extensions}/aws2-ses/pom.xml | 1 - .../aws2-ses/runtime/pom.xml | 12 ++++ .../main/resources/META-INF/quarkus-extension.yaml | 0 extensions/pom.xml | 1 + poms/bom/pom.xml | 6 ++ 14 files changed, 105 insertions(+), 51 deletions(-) diff --git a/docs/modules/ROOT/pages/extensions/aws2-ses.adoc b/docs/modules/ROOT/pages/extensions/aws2-ses.adoc index fbec5bf..81480e8 100644 --- a/docs/modules/ROOT/pages/extensions/aws2-ses.adoc +++ b/docs/modules/ROOT/pages/extensions/aws2-ses.adoc @@ -5,7 +5,7 @@ = AWS 2 Simple Email Service [.badges] -[.badge-key]##Since Camel Quarkus##[.badge-version]##1.0.0-M6## [.badge-key]##JVM##[.badge-supported]##supported## [.badge-key]##Native##[.badge-unsupported]##unsupported## +[.badge-key]##Since Camel Quarkus##[.badge-version]##1.0.0-M6## [.badge-key]##JVM##[.badge-supported]##supported## [.badge-key]##Native##[.badge-supported]##supported## Send e-mails through AWS SES service using AWS SDK version 2.x. @@ -26,3 +26,9 @@ Please refer to the above link for usage and configuration details. ---- 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 975f825..b911fa9 100644 --- a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc +++ b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc @@ -56,7 +56,7 @@ Number of Camel components: 150 in 115 JAR artifacts (0 deprecated) | xref:extensions/aws2-s3.adoc[AWS 2 S3 Storage Service] | camel-quarkus-aws2-s3 | Native + Stable | 1.0.0-M7 | Store and retrie objects from AWS S3 Storage Service using AWS SDK version 2.x. -| xref:extensions/aws2-ses.adoc[AWS 2 Simple Email Service (SES)] | camel-quarkus-aws2-ses | JVM + Preview | 1.0.0-M6 | Send e-mails through AWS SES service using AWS SDK version 2.x. +| xref:extensions/aws2-ses.adoc[AWS 2 Simple Email Service (SES)] | camel-quarkus-aws2-ses | Native + Stable | 1.0.0-M6 | Send e-mails through AWS SES service using AWS SDK version 2.x. | xref:extensions/aws2-sns.adoc[AWS 2 Simple Notification System (SNS)] | camel-quarkus-aws2-sns | Native + Stable | 1.0.0-M6 | Send messages to an AWS Simple Notification Topic using AWS SDK version 2.x. diff --git a/extensions-jvm/aws2-ses/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/ses/deployment/Aws2SesProcessor.java b/extensions-jvm/aws2-ses/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/ses/deployment/Aws2SesProcessor.java deleted file mode 100644 index 804c049..0000000 --- a/extensions-jvm/aws2-ses/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/ses/deployment/Aws2SesProcessor.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.ses.deployment; - -import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.annotations.ExecutionTime; -import io.quarkus.deployment.annotations.Record; -import io.quarkus.deployment.builditem.FeatureBuildItem; -import io.quarkus.deployment.pkg.steps.NativeBuild; -import org.apache.camel.quarkus.core.JvmOnlyRecorder; -import org.jboss.logging.Logger; - -class Aws2SesProcessor { - private static final Logger LOG = Logger.getLogger(Aws2SesProcessor.class); - - private static final String FEATURE = "camel-aws2-ses"; - - @BuildStep - FeatureBuildItem feature() { - return new FeatureBuildItem(FEATURE); - } - - /** - * Remove this once this extension starts supporting the native mode. - */ - @BuildStep(onlyIf = NativeBuild.class) - @Record(value = ExecutionTime.RUNTIME_INIT) - void warnJvmInNative(JvmOnlyRecorder recorder) { - JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time - recorder.warnJvmInNative(FEATURE); // warn at runtime - } - -} diff --git a/extensions-jvm/pom.xml b/extensions-jvm/pom.xml index 28e2563..9f668f9 100644 --- a/extensions-jvm/pom.xml +++ b/extensions-jvm/pom.xml @@ -35,7 +35,6 @@ <modules> <!-- extensions a..z; do not remove this comment, it is important when sorting via mvn process-resources -Pformat --> <module>avro-rpc</module> - <module>aws2-ses</module> <module>cassandraql</module> <module>couchbase</module> <module>debezium-mongodb</module> diff --git a/extensions-jvm/aws2-ses/deployment/pom.xml b/extensions/aws2-ses/deployment/pom.xml similarity index 84% rename from extensions-jvm/aws2-ses/deployment/pom.xml rename to extensions/aws2-ses/deployment/pom.xml index 5cfa017..c8b5a65 100644 --- a/extensions-jvm/aws2-ses/deployment/pom.xml +++ b/extensions/aws2-ses/deployment/pom.xml @@ -50,6 +50,18 @@ <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws2-ses</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> diff --git a/extensions/aws2-ses/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/ses/deployment/Aws2SesProcessor.java b/extensions/aws2-ses/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/ses/deployment/Aws2SesProcessor.java new file mode 100644 index 0000000..7a0c86d --- /dev/null +++ b/extensions/aws2-ses/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/ses/deployment/Aws2SesProcessor.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.ses.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 Aws2SesProcessor { + private static final String FEATURE = "camel-aws2-ses"; + + 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-jvm/aws2-ses/integration-test/pom.xml b/extensions/aws2-ses/integration-test/pom.xml similarity index 100% rename from extensions-jvm/aws2-ses/integration-test/pom.xml rename to extensions/aws2-ses/integration-test/pom.xml diff --git a/extensions-jvm/aws2-ses/integration-test/src/main/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesResource.java b/extensions/aws2-ses/integration-test/src/main/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesResource.java similarity index 100% rename from extensions-jvm/aws2-ses/integration-test/src/main/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesResource.java rename to extensions/aws2-ses/integration-test/src/main/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesResource.java diff --git a/extensions-jvm/aws2-ses/integration-test/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesTest.java b/extensions/aws2-ses/integration-test/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesTest.java similarity index 100% rename from extensions-jvm/aws2-ses/integration-test/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesTest.java rename to extensions/aws2-ses/integration-test/src/test/java/org/apache/camel/quarkus/component/aws2/ses/it/Aws2SesTest.java diff --git a/extensions-jvm/aws2-ses/pom.xml b/extensions/aws2-ses/pom.xml similarity index 97% rename from extensions-jvm/aws2-ses/pom.xml rename to extensions/aws2-ses/pom.xml index 03069af..496a0af 100644 --- a/extensions-jvm/aws2-ses/pom.xml +++ b/extensions/aws2-ses/pom.xml @@ -33,6 +33,5 @@ <modules> <module>deployment</module> <module>runtime</module> - <module>integration-test</module> </modules> </project> diff --git a/extensions-jvm/aws2-ses/runtime/pom.xml b/extensions/aws2-ses/runtime/pom.xml similarity index 87% rename from extensions-jvm/aws2-ses/runtime/pom.xml rename to extensions/aws2-ses/runtime/pom.xml index 7a20c0e..2776ca2 100644 --- a/extensions-jvm/aws2-ses/runtime/pom.xml +++ b/extensions/aws2-ses/runtime/pom.xml @@ -54,6 +54,18 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-aws2-ses</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> diff --git a/extensions-jvm/aws2-ses/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/aws2-ses/runtime/src/main/resources/META-INF/quarkus-extension.yaml similarity index 100% rename from extensions-jvm/aws2-ses/runtime/src/main/resources/META-INF/quarkus-extension.yaml rename to extensions/aws2-ses/runtime/src/main/resources/META-INF/quarkus-extension.yaml diff --git a/extensions/pom.xml b/extensions/pom.xml index 55f3bbd..78099ce 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -62,6 +62,7 @@ <module>aws2-mq</module> <module>aws2-msk</module> <module>aws2-s3</module> + <module>aws2-ses</module> <module>aws2-sns</module> <module>aws2-sqs</module> <module>aws2-translate</module> diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml index 01348e1..5cb9e30 100644 --- a/poms/bom/pom.xml +++ b/poms/bom/pom.xml @@ -330,6 +330,12 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-aws2-ses</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>
