-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add modules for elastic load balancing clients (#1504)
* add elasticloadbalancingv2 module * add elasticloadbalancing module
- Loading branch information
Showing
29 changed files
with
8,200 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
= Amazon Elastic Load Balancing Client | ||
|
||
include::./includes/attributes.adoc[] | ||
|
||
Amazon Elastic Load Balancing automatically distributes incoming application traffic across multiple targets and virtual appliances in one or more Availability Zones (AZs). | ||
|
||
You can find more information about Elastic Load Balancing at https://docs.aws.amazon.com/elasticloadbalancing/[the Amazon Elastic Load Balancing website]. | ||
|
||
NOTE: The Elastic Load Balancing extension is based on https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/welcome.html[AWS Java SDK 2.x]. | ||
It's a major rewrite of the 1.x code base that offers two programming models (Blocking & Async). | ||
|
||
The Quarkus extension supports two programming models: | ||
|
||
* Blocking access using URL Connection HTTP client (by default) or the Apache HTTP Client | ||
* https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/basics-async.html[Asynchronous programming] based on JDK's `CompletableFuture` objects and the Netty HTTP client (by default) or the AWS CRT-based HTTP client | ||
include::./includes/quarkus-amazon-elasticloadbalancing.adoc[] |
17 changes: 17 additions & 0 deletions
17
docs/modules/ROOT/pages/amazon-elasticloadbalancingv2.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
= Amazon Elastic Load Balancing v2 Client | ||
|
||
include::./includes/attributes.adoc[] | ||
|
||
Amazon Elastic Load Balancing automatically distributes incoming application traffic across multiple targets and virtual appliances in one or more Availability Zones (AZs). | ||
|
||
You can find more information about Elastic Load Balancing at https://docs.aws.amazon.com/elasticloadbalancing/[the Amazon Elastic Load Balancing website]. | ||
|
||
NOTE: The Elastic Load Balancing v2 extension is based on https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/welcome.html[AWS Java SDK 2.x]. | ||
It's a major rewrite of the 1.x code base that offers two programming models (Blocking & Async). | ||
|
||
The Quarkus extension supports two programming models: | ||
|
||
* Blocking access using URL Connection HTTP client (by default) or the Apache HTTP Client | ||
* https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/basics-async.html[Asynchronous programming] based on JDK's `CompletableFuture` objects and the Netty HTTP client (by default) or the AWS CRT-based HTTP client | ||
include::./includes/quarkus-amazon-elasticloadbalancingv2.adoc[] |
1,748 changes: 1,748 additions & 0 deletions
1,748
docs/modules/ROOT/pages/includes/quarkus-amazon-elasticloadbalancing.adoc
Large diffs are not rendered by default.
Oops, something went wrong.
1,748 changes: 1,748 additions & 0 deletions
1,748
.../includes/quarkus-amazon-elasticloadbalancing_quarkus.elasticloadbalancing.adoc
Large diffs are not rendered by default.
Oops, something went wrong.
1,748 changes: 1,748 additions & 0 deletions
1,748
docs/modules/ROOT/pages/includes/quarkus-amazon-elasticloadbalancingv2.adoc
Large diffs are not rendered by default.
Oops, something went wrong.
1,748 changes: 1,748 additions & 0 deletions
1,748
...ludes/quarkus-amazon-elasticloadbalancingv2_quarkus.elasticloadbalancingv2.adoc
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.quarkiverse.amazonservices</groupId> | ||
<artifactId>quarkus-amazon-elasticloadbalancing-parent</artifactId> | ||
<version>999-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>quarkus-amazon-elasticloadbalancing-deployment</artifactId> | ||
<name>Quarkus - Amazon Services - Elastic Load Balancing - Deployment</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-core-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-arc-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkiverse.amazonservices</groupId> | ||
<artifactId>quarkus-amazon-common-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkiverse.amazonservices</groupId> | ||
<artifactId>quarkus-amazon-elasticloadbalancing</artifactId> | ||
</dependency> | ||
|
||
<!-- Test dependencies --> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5-internal</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.rest-assured</groupId> | ||
<artifactId>rest-assured</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>software.amazon.awssdk</groupId> | ||
<artifactId>netty-nio-client</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<!-- Imported manually because conditional dependencies | ||
are not automatically added to test scope --> | ||
<dependency> | ||
<groupId>io.quarkiverse.amazonservices</groupId> | ||
<artifactId>quarkus-amazon-netty-client-internal-deployment</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>software.amazon.awssdk</groupId> | ||
<artifactId>aws-crt-client</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>software.amazon.awssdk</groupId> | ||
<artifactId>url-connection-client</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<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> |
215 changes: 215 additions & 0 deletions
215
.../io/quarkiverse/amazon/elasticloadbalancing/deployment/ElasticLoadBalancingProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,215 @@ | ||
package io.quarkiverse.amazon.elasticloadbalancing.deployment; | ||
|
||
import java.util.List; | ||
|
||
import org.jboss.jandex.DotName; | ||
|
||
import io.quarkiverse.amazon.common.deployment.AbstractAmazonServiceProcessor; | ||
import io.quarkiverse.amazon.common.deployment.AmazonClientAsyncResultBuildItem; | ||
import io.quarkiverse.amazon.common.deployment.AmazonClientAsyncTransportBuildItem; | ||
import io.quarkiverse.amazon.common.deployment.AmazonClientInterceptorsPathBuildItem; | ||
import io.quarkiverse.amazon.common.deployment.AmazonClientSyncResultBuildItem; | ||
import io.quarkiverse.amazon.common.deployment.AmazonClientSyncTransportBuildItem; | ||
import io.quarkiverse.amazon.common.deployment.AmazonHttpClients; | ||
import io.quarkiverse.amazon.common.deployment.RequireAmazonClientBuildItem; | ||
import io.quarkiverse.amazon.common.deployment.RequireAmazonClientInjectionBuildItem; | ||
import io.quarkiverse.amazon.common.deployment.RequireAmazonClientTransportBuilderBuildItem; | ||
import io.quarkiverse.amazon.common.deployment.RequireAmazonTelemetryBuildItem; | ||
import io.quarkiverse.amazon.common.deployment.spi.EventLoopGroupBuildItem; | ||
import io.quarkiverse.amazon.common.runtime.AmazonClientApacheTransportRecorder; | ||
import io.quarkiverse.amazon.common.runtime.AmazonClientAwsCrtTransportRecorder; | ||
import io.quarkiverse.amazon.common.runtime.AmazonClientCommonRecorder; | ||
import io.quarkiverse.amazon.common.runtime.AmazonClientNettyTransportRecorder; | ||
import io.quarkiverse.amazon.common.runtime.AmazonClientOpenTelemetryRecorder; | ||
import io.quarkiverse.amazon.common.runtime.AmazonClientUrlConnectionTransportRecorder; | ||
import io.quarkiverse.amazon.elasticloadbalancing.runtime.ElasticLoadBalancingBuildTimeConfig; | ||
import io.quarkiverse.amazon.elasticloadbalancing.runtime.ElasticLoadBalancingRecorder; | ||
import io.quarkus.arc.deployment.BeanRegistrationPhaseBuildItem; | ||
import io.quarkus.arc.deployment.SyntheticBeanBuildItem; | ||
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.ExecutorBuildItem; | ||
import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem; | ||
import io.quarkus.deployment.builditem.FeatureBuildItem; | ||
import io.quarkus.deployment.builditem.LaunchModeBuildItem; | ||
import software.amazon.awssdk.services.elasticloadbalancing.ElasticLoadBalancingAsyncClient; | ||
import software.amazon.awssdk.services.elasticloadbalancing.ElasticLoadBalancingAsyncClientBuilder; | ||
import software.amazon.awssdk.services.elasticloadbalancing.ElasticLoadBalancingClient; | ||
import software.amazon.awssdk.services.elasticloadbalancing.ElasticLoadBalancingClientBuilder; | ||
|
||
public class ElasticLoadBalancingProcessor extends AbstractAmazonServiceProcessor { | ||
|
||
private static final String AMAZON_CLIENT_NAME = "amazon-sdk-elasticloadbalancing"; | ||
|
||
ElasticLoadBalancingBuildTimeConfig buildTimeConfig; | ||
|
||
@Override | ||
protected String amazonServiceClientName() { | ||
return AMAZON_CLIENT_NAME; | ||
} | ||
|
||
@Override | ||
protected String configName() { | ||
return "elasticloadbalancing"; | ||
} | ||
|
||
@Override | ||
protected DotName syncClientName() { | ||
return DotName.createSimple(ElasticLoadBalancingClient.class.getName()); | ||
} | ||
|
||
@Override | ||
protected DotName asyncClientName() { | ||
return DotName.createSimple(ElasticLoadBalancingAsyncClient.class.getName()); | ||
} | ||
|
||
@Override | ||
protected String builtinInterceptorsPath() { | ||
return "software/amazon/awssdk/services/elasticloadbalancing/execution.interceptors"; | ||
} | ||
|
||
@BuildStep | ||
void setup( | ||
BuildProducer<ExtensionSslNativeSupportBuildItem> extensionSslNativeSupport, | ||
BuildProducer<FeatureBuildItem> feature, | ||
BuildProducer<AmazonClientInterceptorsPathBuildItem> interceptors) { | ||
|
||
setupExtension(extensionSslNativeSupport, feature, interceptors); | ||
} | ||
|
||
@BuildStep | ||
void discoverClientInjectionPoints(BeanRegistrationPhaseBuildItem beanRegistrationPhase, | ||
BuildProducer<RequireAmazonClientInjectionBuildItem> requireClientInjectionProducer) { | ||
|
||
discoverClientInjectionPointsInternal(beanRegistrationPhase, requireClientInjectionProducer); | ||
} | ||
|
||
@BuildStep | ||
void discover( | ||
List<RequireAmazonClientInjectionBuildItem> amazonClientInjectionPoints, | ||
BuildProducer<RequireAmazonClientBuildItem> requireClientProducer) { | ||
|
||
discoverClient(amazonClientInjectionPoints, requireClientProducer); | ||
} | ||
|
||
@BuildStep | ||
void discoverTelemetry(BuildProducer<RequireAmazonTelemetryBuildItem> telemetryProducer) { | ||
|
||
discoverTelemetry(telemetryProducer, buildTimeConfig.sdk()); | ||
} | ||
|
||
@BuildStep | ||
void setupClient(List<RequireAmazonClientBuildItem> clientRequirements, | ||
BuildProducer<RequireAmazonClientTransportBuilderBuildItem> clientProducer) { | ||
|
||
setupClient(clientRequirements, clientProducer, buildTimeConfig.sdk(), buildTimeConfig.syncClient(), | ||
buildTimeConfig.asyncClient()); | ||
} | ||
|
||
@BuildStep(onlyIf = AmazonHttpClients.IsAmazonApacheHttpServicePresent.class) | ||
@Record(ExecutionTime.RUNTIME_INIT) | ||
void setupApacheSyncTransport(List<RequireAmazonClientTransportBuilderBuildItem> amazonClients, | ||
ElasticLoadBalancingRecorder recorder, | ||
AmazonClientApacheTransportRecorder transportRecorder, | ||
BuildProducer<AmazonClientSyncTransportBuildItem> syncTransports) { | ||
|
||
createApacheSyncTransportBuilder(amazonClients, | ||
transportRecorder, | ||
buildTimeConfig.syncClient(), | ||
recorder.getSyncConfig(), | ||
syncTransports); | ||
} | ||
|
||
@BuildStep(onlyIf = AmazonHttpClients.IsAmazonAwsCrtHttpServicePresent.class) | ||
@Record(ExecutionTime.RUNTIME_INIT) | ||
void setupAwsCrtSyncTransport(List<RequireAmazonClientTransportBuilderBuildItem> amazonClients, | ||
ElasticLoadBalancingRecorder recorder, | ||
AmazonClientAwsCrtTransportRecorder transportRecorder, | ||
BuildProducer<AmazonClientSyncTransportBuildItem> syncTransports) { | ||
|
||
createAwsCrtSyncTransportBuilder(amazonClients, | ||
transportRecorder, | ||
buildTimeConfig.syncClient(), | ||
recorder.getSyncConfig(), | ||
syncTransports); | ||
} | ||
|
||
@BuildStep(onlyIf = AmazonHttpClients.IsAmazonUrlConnectionHttpServicePresent.class) | ||
@Record(ExecutionTime.RUNTIME_INIT) | ||
void setupUrlConnectionSyncTransport(List<RequireAmazonClientTransportBuilderBuildItem> amazonClients, | ||
ElasticLoadBalancingRecorder recorder, | ||
AmazonClientUrlConnectionTransportRecorder transportRecorder, | ||
BuildProducer<AmazonClientSyncTransportBuildItem> syncTransports) { | ||
|
||
createUrlConnectionSyncTransportBuilder(amazonClients, | ||
transportRecorder, | ||
buildTimeConfig.syncClient(), | ||
recorder.getSyncConfig(), | ||
syncTransports); | ||
} | ||
|
||
@BuildStep(onlyIf = AmazonHttpClients.IsAmazonNettyHttpServicePresent.class) | ||
@Record(ExecutionTime.RUNTIME_INIT) | ||
void setupNettyAsyncTransport(List<RequireAmazonClientTransportBuilderBuildItem> amazonClients, | ||
ElasticLoadBalancingRecorder recorder, | ||
AmazonClientNettyTransportRecorder transportRecorder, | ||
BuildProducer<AmazonClientAsyncTransportBuildItem> asyncTransports, | ||
EventLoopGroupBuildItem eventLoopSupplier) { | ||
|
||
createNettyAsyncTransportBuilder(amazonClients, | ||
transportRecorder, | ||
buildTimeConfig.asyncClient(), | ||
recorder.getAsyncConfig(), | ||
asyncTransports, eventLoopSupplier.getMainEventLoopGroup()); | ||
} | ||
|
||
@BuildStep(onlyIf = AmazonHttpClients.IsAmazonAwsCrtHttpServicePresent.class) | ||
@Record(ExecutionTime.RUNTIME_INIT) | ||
void setupAwsCrtAsyncTransport(List<RequireAmazonClientTransportBuilderBuildItem> amazonClients, | ||
ElasticLoadBalancingRecorder recorder, | ||
AmazonClientAwsCrtTransportRecorder transportRecorder, | ||
BuildProducer<AmazonClientAsyncTransportBuildItem> asyncTransports) { | ||
|
||
createAwsCrtAsyncTransportBuilder(amazonClients, | ||
transportRecorder, | ||
buildTimeConfig.asyncClient(), | ||
recorder.getAsyncConfig(), | ||
asyncTransports); | ||
} | ||
|
||
@BuildStep | ||
@Record(ExecutionTime.RUNTIME_INIT) | ||
void createClientBuilders(ElasticLoadBalancingRecorder recorder, | ||
AmazonClientCommonRecorder commonRecorder, | ||
AmazonClientOpenTelemetryRecorder otelRecorder, | ||
List<RequireAmazonClientInjectionBuildItem> amazonClientInjections, | ||
List<RequireAmazonTelemetryBuildItem> amazonRequireTelemtryClients, | ||
List<AmazonClientSyncTransportBuildItem> syncTransports, | ||
List<AmazonClientAsyncTransportBuildItem> asyncTransports, | ||
BuildProducer<SyntheticBeanBuildItem> syntheticBeans, | ||
BuildProducer<AmazonClientSyncResultBuildItem> clientSync, | ||
BuildProducer<AmazonClientAsyncResultBuildItem> clientAsync, | ||
LaunchModeBuildItem launchModeBuildItem, | ||
ExecutorBuildItem executorBuildItem) { | ||
|
||
createClientBuilders( | ||
recorder, | ||
commonRecorder, | ||
otelRecorder, | ||
buildTimeConfig, | ||
amazonClientInjections, | ||
amazonRequireTelemtryClients, | ||
syncTransports, | ||
asyncTransports, | ||
ElasticLoadBalancingClientBuilder.class, | ||
ElasticLoadBalancingAsyncClientBuilder.class, | ||
null, | ||
syntheticBeans, | ||
clientSync, | ||
clientAsync, | ||
launchModeBuildItem, | ||
executorBuildItem); | ||
} | ||
} |
Oops, something went wrong.