Skip to content

Commit

Permalink
Upgrade to azure-bom 1.0.3 and fix #2207 Upgrading to Jackson 2.12.1 …
Browse files Browse the repository at this point in the history
…via Quarkus BOM 1.12 breaks Azure SDK v12 extensions
  • Loading branch information
ppalaga committed Jun 18, 2021
1 parent 9b4232d commit 86719f9
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 75 deletions.
4 changes: 4 additions & 0 deletions extensions-jvm/azure-cosmosdb/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-support-azure-core-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-azure-cosmosdb</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions extensions-jvm/azure-cosmosdb/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-support-azure-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-azure-cosmosdb</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@

<dependencyManagement>
<dependencies>
<dependency><!-- Workaround for https://github.com/apache/camel-quarkus/issues/2207 -->
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.11.3</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bom-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,34 @@
import java.util.Set;
import java.util.stream.Stream;

import com.azure.core.annotation.ServiceInterface;
import com.azure.core.http.HttpClientProvider;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;
import io.quarkus.deployment.util.ServiceUtil;
import org.jboss.jandex.DotName;

public class AzureCoreSupportProcessor {
static final String FEATURE = "camel-support-azure-core";

private static final DotName SERVICE_INTERFACE_DOT_NAME = DotName.createSimple(ServiceInterface.class.getName());

@BuildStep
IndexDependencyBuildItem indexDependency() {
return new IndexDependencyBuildItem("com.azure", "azure-core");
}

@BuildStep
void reflectiveClasses(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses) {
reflectiveClasses.produce(new ReflectiveClassBuildItem(false, false, com.azure.core.util.DateTimeRfc1123.class));
reflectiveClasses.produce(new ReflectiveClassBuildItem(false, false,
com.azure.core.util.DateTimeRfc1123.class,
com.azure.core.http.rest.StreamResponse.class));
}

@BuildStep
Expand Down Expand Up @@ -67,4 +75,19 @@ void nativeResources(BuildProducer<ServiceProviderBuildItem> services,
nativeResources.produce(new NativeImageResourceBuildItem(
"azure-core.properties"));
}

@BuildStep
void proxyDefinitions(
CombinedIndexBuildItem combinedIndex,
BuildProducer<NativeImageProxyDefinitionBuildItem> proxyDefinitions) {

combinedIndex
.getIndex()
.getAnnotations(SERVICE_INTERFACE_DOT_NAME)
.stream()
.map(annotationInstance -> annotationInstance.target().asClass().name().toString())
.map(NativeImageProxyDefinitionBuildItem::new)
.forEach(proxyDefinitions::produce);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ void runtimeInitializedClasses(BuildProducer<RuntimeInitializedClassBuildItem> r
/* The following io.netty.util.* items were not accepted
* to quarkus via https://github.com/quarkusio/quarkus/pull/14994
* Keeping them here for now */
"io.netty.util.NetUtil",
"io.netty.channel.socket.InternetProtocolFamily",
"io.netty.handler.ssl.OpenSsl",
io.netty.util.NetUtil.class.getName(),
io.netty.channel.socket.InternetProtocolFamily.class.getName(),
"io.netty.channel.socket.InternetProtocolFamily$1",
"io.netty.channel.socket.nio.ProtocolFamilyConverter$1",
io.netty.handler.ssl.OpenSsl.class.getName(),
"io.netty.internal.tcnative.SSL",
"io.netty.resolver.dns.PreferredAddressTypeComparator$1",

"reactor.netty.http.client.HttpClient",
"reactor.netty.tcp.TcpClient",
reactor.netty.http.client.HttpClient.class.getName(),
"reactor.netty.http.client.HttpClientSecure",
reactor.netty.tcp.TcpClient.class.getName(),
"reactor.netty.tcp.TcpClientSecure",
"reactor.netty.resources.DefaultLoopNativeDetector",
"reactor.netty.resources.DefaultLoopEpoll",
"reactor.netty.resources.DefaultLoopKQueue",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
*/
package org.apache.camel.quarkus.component.azure.storage.blob.deployment;

import java.util.stream.Stream;

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.jboss.jandex.ClassInfo;
Expand All @@ -44,20 +41,6 @@ ExtensionSslNativeSupportBuildItem activateSslNativeSupport() {
return new ExtensionSslNativeSupportBuildItem(FEATURE);
}

@BuildStep
void proxyDefinitions(BuildProducer<NativeImageProxyDefinitionBuildItem> proxyDefinitions) {
Stream.of(
"com.azure.storage.blob.implementation.AppendBlobsImpl$AppendBlobsService",
"com.azure.storage.blob.implementation.BlobsImpl$BlobsService",
"com.azure.storage.blob.implementation.BlockBlobsImpl$BlockBlobsService",
"com.azure.storage.blob.implementation.ContainersImpl$ContainersService",
"com.azure.storage.blob.implementation.DirectorysImpl$DirectorysService",
"com.azure.storage.blob.implementation.PageBlobsImpl$PageBlobsService",
"com.azure.storage.blob.implementation.ServicesImpl$ServicesService")
.map(NativeImageProxyDefinitionBuildItem::new)
.forEach(proxyDefinitions::produce);
}

@BuildStep
void reflectiveClasses(CombinedIndexBuildItem combinedIndex, BuildProducer<ReflectiveClassBuildItem> reflectiveClasses) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
*/
package org.apache.camel.quarkus.component.azure.storage.queue.deployment;

import java.util.stream.Stream;

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.DotName;
Expand All @@ -45,17 +42,6 @@ ExtensionSslNativeSupportBuildItem activateSslNativeSupport() {
return new ExtensionSslNativeSupportBuildItem(FEATURE);
}

@BuildStep
void proxyDefinitions(BuildProducer<NativeImageProxyDefinitionBuildItem> proxyDefinitions) {
Stream.of(
"com.azure.storage.queue.implementation.MessageIdsImpl$MessageIdsService",
"com.azure.storage.queue.implementation.MessagesImpl$MessagesService",
"com.azure.storage.queue.implementation.QueuesImpl$QueuesService",
"com.azure.storage.queue.implementation.ServicesImpl$ServicesService")
.map(NativeImageProxyDefinitionBuildItem::new)
.forEach(proxyDefinitions::produce);
}

@BuildStep
void reflectiveClasses(CombinedIndexBuildItem combinedIndex, BuildProducer<ReflectiveClassBuildItem> reflectiveClasses) {

Expand Down
7 changes: 0 additions & 7 deletions integration-test-groups/azure/azure-eventhubs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@

<dependencyManagement>
<dependencies>
<dependency><!-- Workaround for https://github.com/apache/camel-quarkus/issues/2207 -->
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.11.3</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bom-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

@EnabledIfEnvironmentVariable(named = "AZURE_STORAGE_ACCOUNT_NAME", matches = ".+")
@EnabledIfEnvironmentVariable(named = "AZURE_STORAGE_ACCOUNT_KEY", matches = ".+")
@EnabledIfEnvironmentVariable(named = "AZURE_BLOB_CONTAINER_NAME", matches = ".+")
@EnabledIfEnvironmentVariable(named = "AZURE_EVENT_HUBS_BLOB_CONTAINER_NAME", matches = ".+")
@EnabledIfEnvironmentVariable(named = "AZURE_EVENT_HUBS_CONNECTION_STRING", matches = ".+")
@QuarkusTest
class AzureEventhubsTest {
Expand Down
7 changes: 0 additions & 7 deletions integration-test-groups/azure/azure-storage-blob/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@

<dependencyManagement>
<dependencies>
<dependency><!-- Workaround for https://github.com/apache/camel-quarkus/issues/2207 -->
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.11.3</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bom-test</artifactId>
Expand Down
7 changes: 0 additions & 7 deletions integration-test-groups/azure/azure-storage-queue/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@

<dependencyManagement>
<dependencies>
<dependency><!-- Workaround for https://github.com/apache/camel-quarkus/issues/2207 -->
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.11.3</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bom-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

public class AzureStorageTestResource implements QuarkusTestResourceLifecycleManager {
private static final Logger LOGGER = LoggerFactory.getLogger(AzureStorageTestResource.class);
private static final String AZURITE_IMAGE = "mcr.microsoft.com/azure-storage/azurite:3.10.0";
private static final String AZURITE_IMAGE = "mcr.microsoft.com/azure-storage/azurite:3.13.0";

public enum Service {
blob(10000),
Expand Down
7 changes: 0 additions & 7 deletions integration-tests/azure-grouped/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@

<dependencyManagement>
<dependencies>
<dependency><!-- Workaround for https://github.com/apache/camel-quarkus/issues/2207 -->
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.11.3</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-bom-test</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<antlr3.version>3.5.2</antlr3.version><!-- Spark, Stringtemplate and probably others -->
<avro.version>1.10.2</avro.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.apache.avro:avro -->
<aws-java-sdk.version>1.11.714</aws-java-sdk.version>
<azure-sdk-bom.version>${azure-sdk-bom-version}</azure-sdk-bom.version>
<azure-sdk-bom.version>1.0.3</azure-sdk-bom.version><!-- Revert back to ${azure-sdk-bom-version} with Camel 3.11 see https://github.com/apache/camel/pull/5642 -->
<commons-beanutils.version>${commons-beanutils-version}</commons-beanutils.version>
<commons-cli.version>1.4</commons-cli.version><!-- keep in sync with Quarkus, via quarkus-bootstrap-core -->
<commons-collections.version>3.2.2</commons-collections.version><!-- used by hbase, should be pretty stable as commons-collections are not developed actively anymore -->
Expand Down

0 comments on commit 86719f9

Please sign in to comment.