Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws crt client #64

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencyResolutionManagement {
}
create("aws") {
version("awssdk", "2.25.60")
library("netty", "software.amazon.awssdk", "netty-nio-client").versionRef("awssdk")
library("crtClient", "software.amazon.awssdk", "aws-crt-client").versionRef("awssdk")
library("s3", "software.amazon.awssdk", "s3").versionRef("awssdk")

}
Expand Down
7 changes: 1 addition & 6 deletions spring-funk-aws/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@ dependencies {
api(aws.s3) {
exclude(group = "software.amazon.awssdk", module = "apache-client")
}
implementation(aws.netty)
implementation(aws.crtClient)
implementation(libs.slf4j)
implementation(libs.oshai)
compileOnly("io.micrometer:micrometer-core:1.13.0")
implementation("io.netty:netty-tcnative-boringssl-static:2.0.62.Final")
implementation("io.netty:netty-tcnative-boringssl-static:2.0.62.Final:linux-aarch_64")
implementation("io.netty:netty-tcnative-boringssl-static:2.0.62.Final:osx-aarch_64")
implementation("io.netty:netty-tcnative-boringssl-static:2.0.62.Final:linux-x86_64")
implementation("io.netty:netty-tcnative-boringssl-static:2.0.62.Final:osx-x86_64")

testImplementation(project(":spring-funk-test"))
testImplementation(libs.oshai)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
package com.github.wakingrufus.funk.aws.s3

import io.netty.handler.ssl.SslProvider
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider
import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient
import software.amazon.awssdk.http.crt.AwsCrtAsyncHttpClient
import software.amazon.awssdk.regions.Region
import software.amazon.awssdk.services.s3.S3AsyncClient
import software.amazon.awssdk.services.s3.S3AsyncClientBuilder

internal fun newClientBuilder(clientConfig: S3ClientConfigurationProperties): S3AsyncClientBuilder {
val awsBuilder = S3AsyncClient.builder()
val builder: NettyNioAsyncHttpClient.Builder =
NettyNioAsyncHttpClient.builder()
.sslProvider(SslProvider.OPENSSL)
val builder = AwsCrtAsyncHttpClient.builder()
.maxConcurrency(clientConfig.maxConcurrency)
clientConfig.readWriteTimeout?.also {
builder.readTimeout(it).writeTimeout(it)
// TODO fixme
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the CRT client just not have this feature?

}
clientConfig.connectionTimeout?.also {
builder.connectionAcquisitionTimeout(it).connectionTimeout(it)
builder.connectionTimeout(it)
}
awsBuilder.httpClientBuilder(builder)
clientConfig.region?.also {
Expand Down
Loading