Search code examples
javaspring-bootazureapache-camelazure-sdk

Camel Consumer not reading from Azure Storage Blob post maven upgrade to 3.10


After upgrading to camel 3.10 and upgrading the camel-azure version, the consumer is not reading from the azure storage container any more. Below is my setup

BEFORE

Camel version 3.4.0

        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-azure</artifactId>
            <version>3.4.0</version>
        </dependency>
        <dependency>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-storage</artifactId>
            <version>8.4.0</version>
        </dependency>

@Bean
public StorageCredentialsAccountAndKey credentials(String accountName,String key) {
    return new StorageCredentialsAccountAndKey(accountName, key);
}
from(timer://testRoute?fixedRate=true&period=10s)
.to(azure-blob://azureStorageName/azureContainerName?credentials=#credentials&operation=listBlobs)
.process("myProcessor");

AFTER

Camel Version 3.10

        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-azure-storage-blob</artifactId>
            <version>3.10.0</version>
        </dependency>
        <dependency>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-storage</artifactId>
            <version>8.6.6</version>
        </dependency>
@Bean
public StorageSharedKeyCredential credentials(String accountName,String key) {
    return new StorageSharedKeyCredential(accountName, key);
}
from(timer://testRoute?fixedRate=true&period=10s)
.to(azure-storage-blob://azureStorageName/azureContainerName?credentials=#credentials&operation=listBlobs)
.process("myProcessor");

Route has started and the application looks good, but nothing is consumed

INFO  main [camel.spring.boot.CamelSpringBootApplicationListener(onCamelContextStarted:146)] Starting CamelMainRunController to ensure the main thread keeps running
INFO  main [camel.impl.engine.AbstractCamelContext(logStartSummary:2983)] Routes startup summary (total:1 started:1)
INFO  main [camel.impl.engine.AbstractCamelContext(logStartSummary:2988)]     Started testRoute (timer://test)
INFO  main [camel.impl.engine.AbstractCamelContext(logStartSummary:3000)] Apache Camel 3.10.0 (camel-1) started in 877ms (build:28ms init:232ms start:617ms)
INFO  main [nl.ecs.batchfraudscoringadapter.BatchFraudScoringAdapterApplication(logStarted:61)] Started MyApplication in xxx seconds (JVM running for xxx)
INFO  main [springframework.boot.availability.ApplicationAvailabilityBean(logStateChange:75)] Application availability state LivenessState changed to CORRECT
INFO  main [springframework.boot.availability.ApplicationAvailabilityBean(logStateChange:75)] Application availability state ReadinessState changed to ACCEPTING_TRAFFIC
INFO  main [nl.ecs.batchfraudscoringadapter.BatchFraudScoringAdapterApplication(main:28)] MyApplication Started

What am I missing here ?

-Regards Srikant


Solution

  • Thank you Pasi Österman. Posting your suggestions as an answer to help other community members.

    The camel-azure-storage-blob uses Azure SDK version 12 but com.microsoft.azure/azure-storage/8.6.6 is for SDK version 8

    If you use it in your myProcessor you might have to update the processor to use a newer version of the SDK. The dependency camel-azure-storage-blob probably already contains dependencies for more recent version of SDK so you could use those instead.

    You can refer to Camel Azure Storage Blob Service