This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch aws2-msk in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit d456ee73a1427f543996cd766af5df0d60c7f811 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Fri Jun 19 11:22:24 2020 +0200 AWS2-MSK: Regen and rebuild --- docs/modules/ROOT/pages/extensions/aws2-mq.adoc | 6 +++ docs/modules/ROOT/pages/extensions/aws2-msk.adoc | 8 +++- .../pages/list-of-camel-quarkus-extensions.adoc | 2 + .../aws2/msk/deployment/Aws2MskProcessor.java | 49 +++++++++++++++------- 4 files changed, 49 insertions(+), 16 deletions(-) diff --git a/docs/modules/ROOT/pages/extensions/aws2-mq.adoc b/docs/modules/ROOT/pages/extensions/aws2-mq.adoc index 3805d57..50193d7 100644 --- a/docs/modules/ROOT/pages/extensions/aws2-mq.adoc +++ b/docs/modules/ROOT/pages/extensions/aws2-mq.adoc @@ -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/extensions/aws2-msk.adoc b/docs/modules/ROOT/pages/extensions/aws2-msk.adoc index 9163386..278f341 100644 --- a/docs/modules/ROOT/pages/extensions/aws2-msk.adoc +++ b/docs/modules/ROOT/pages/extensions/aws2-msk.adoc @@ -5,7 +5,7 @@ = AWS 2 MSK [.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## Manage AWS MSK instances 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 9222bc8..4750a89 100644 --- a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc +++ b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc @@ -50,6 +50,8 @@ Number of Camel components: 150 in 115 JAR artifacts (0 deprecated) | xref:extensions/aws2-kms.adoc[AWS 2 Key Management Service (KMS)] | camel-quarkus-aws2-kms | Native + Stable | 1.0.0-M6 | Manage keys stored in AWS KMS instances using AWS SDK version 2.x. +| xref:extensions/aws2-msk.adoc[AWS 2 Managed Streaming for Apache Kafka (MSK)] | camel-quarkus-aws2-msk | Native + Stable | 1.0.0-M6 | Manage AWS MSK instances using AWS SDK version 2.x. + | xref:extensions/aws2-mq.adoc[AWS 2 MQ] | camel-quarkus-aws2-mq | Native + Stable | 1.0.0-M6 | Manage AWS MQ instances using AWS SDK version 2.x. | 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. diff --git a/extensions/aws2-msk/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/msk/deployment/Aws2MskProcessor.java b/extensions/aws2-msk/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/msk/deployment/Aws2MskProcessor.java index b39c654..62ce779 100644 --- a/extensions/aws2-msk/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/msk/deployment/Aws2MskProcessor.java +++ b/extensions/aws2-msk/deployment/src/main/java/org/apache/camel/quarkus/component/aws2/msk/deployment/Aws2MskProcessor.java @@ -16,32 +16,51 @@ */ package org.apache.camel.quarkus.component.aws2.msk.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.annotations.ExecutionTime; -import io.quarkus.deployment.annotations.Record; +import io.quarkus.deployment.builditem.CombinedIndexBuildItem; 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; +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 Aws2MskProcessor { - private static final Logger LOG = Logger.getLogger(Aws2MskProcessor.class); - private static final String FEATURE = "camel-aws2-msk"; + 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); } - /** - * 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 + @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())); } }