Skip to content

Commit 9b9f04f

Browse files
authored
Merge pull request #2455 from atlanhq/CSA-390
fix(adls): swap Azure HTTP transport from Netty to OkHttp (CSA-390)
2 parents 427a999 + fd20b63 commit 9b9f04f

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ angus-mail = "2.0.5"
2626
pkl = "0.31.1"
2727
adls = "12.26.3"
2828
azure = "1.18.2"
29+
azure-core-http-okhttp = "1.13.4"
2930
guava = "33.6.0-jre"
3031
openlineage = "1.46.0"
3132
kotlin = "2.3.20"
@@ -57,6 +58,7 @@ gcs = { module = "com.google.cloud:google-cloud-storage" }
5758
gcs-control = { module = "com.google.cloud:google-cloud-storage-control" }
5859
adls = { module = "com.azure:azure-storage-file-datalake", version.ref = "adls" }
5960
azure-identity = { module = "com.azure:azure-identity", version.ref = "azure" }
61+
azure-core-http-okhttp = { module = "com.azure:azure-core-http-okhttp", version.ref = "azure-core-http-okhttp" }
6062
system-stubs = { module = "uk.org.webcompere:system-stubs-testng", version.ref = "system-stubs" }
6163
fastcsv = { module = "de.siegmar:fastcsv", version.ref = "fastcsv" }
6264
apache-poi = { module = "org.apache.poi:poi", version.ref = "poi" }

package-toolkit/runtime/build.gradle.kts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ dependencies {
2525
api(libs.awssdk.sts)
2626
api(platform(libs.gcs.bom))
2727
api(libs.gcs)
28-
api(libs.azure.identity)
29-
api(libs.adls)
28+
api(libs.azure.identity) {
29+
exclude(group = "com.azure", module = "azure-core-http-netty")
30+
}
31+
api(libs.adls) {
32+
exclude(group = "com.azure", module = "azure-core-http-netty")
33+
}
34+
api(libs.azure.core.http.okhttp)
3035
implementation(libs.sqlite)
3136
implementation(libs.simple.java.mail)
3237
implementation(libs.log4j.core) // This gives us the OOTB-log4j appenders (that we MUST have for pattern-handling)
@@ -189,7 +194,7 @@ tasks {
189194
include(dependency("com.microsoft.azure:msal4j-persistence-extension:.*"))
190195
include(dependency("net.java.dev.jna:jna:.*"))
191196
include(dependency("net.java.dev.jna:jna-platform:.*"))
192-
include(dependency("com.azure:azure-core-http-netty:.*"))
197+
include(dependency("com.azure:azure-core-http-okhttp:.*"))
193198
include(dependency("com.azure:azure-core:.*"))
194199
include(dependency("com.azure:azure-json:.*"))
195200
include(dependency("com.azure:azure-storage-blob:.*"))

package-toolkit/runtime/src/main/kotlin/com/atlan/pkg/objectstore/ADLSSync.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Copyright 2023 Atlan Pte. Ltd. */
33
package com.atlan.pkg.objectstore
44

5+
import com.azure.core.http.okhttp.OkHttpAsyncHttpClientBuilder
56
import com.azure.identity.ClientSecretCredentialBuilder
67
import com.azure.storage.blob.BlobContainerClient
78
import com.azure.storage.blob.BlobContainerClientBuilder
@@ -36,18 +37,21 @@ class ADLSSync(
3637
private val blobContainerClient: BlobContainerClient?
3738

3839
init {
40+
val httpClient = OkHttpAsyncHttpClientBuilder().build()
3941
if (tenantId.isNotBlank() && clientId.isNotBlank()) {
4042
logger.info { "Authenticating to ADLS using provided tenant and client IDs and secrets." }
4143
val credential =
4244
ClientSecretCredentialBuilder()
4345
.tenantId(tenantId)
4446
.clientId(clientId)
4547
.clientSecret(clientSecret)
48+
.httpClient(httpClient)
4649
.build()
4750
adlsClient =
4851
DataLakeServiceClientBuilder()
4952
.endpoint("https://$accountName.dfs.core.windows.net")
5053
.credential(credential)
54+
.httpClient(httpClient)
5155
.buildClient()
5256
blobContainerClient = null
5357
} else {
@@ -61,6 +65,7 @@ class ADLSSync(
6165
.endpoint("https://$accountName.blob.core.windows.net")
6266
.credential(credential)
6367
.containerName(containerName)
68+
.httpClient(httpClient)
6469
.buildClient()
6570
adlsClient = null
6671
}

0 commit comments

Comments
 (0)