azure storage blob cdc source Azure Storage Blob CDC Source

Provided by: "Apache Software Foundation"

Support Level for this Kamelet is: "Preview"

Receive data from Azure Service Bus subscribed to Azure Eventgrid reporting events related to a Azure Storage Blob account.

Connection string is the basic method for authenticating to the Azure Servicebus Queue.

To use this Kamelet you’ll need to set up Events on your Azure Storage Blob account and select as an endpoint an Azure Servicebus Queue.

Configuration Options

The following table summarizes the configuration options available for the azure-storage-blob-cdc-source Kamelet:

Property Name Description Type Default Example

accessKey

Access Key

Required The Azure Storage Blob access key.

string

accountName

Account Name

Required The Azure Storage Blob account name.

string

connectionString

Connection String

Required Connection String for Azure Servicebus instance.

string

containerName

Container Name

Required The Azure Storage Blob container name.

string

topicOrQueueName

Topic Or Queue Name

Required Topic Or Queue Name for the Azure Servicebus instance.

string

credentialType

Credential Type

Determines the credential strategy to adopt.

Enum values:

* SHARED_ACCOUNT_KEY * SHARED_KEY_CREDENTIAL * AZURE_IDENTITY

string

SHARED_ACCOUNT_KEY

getBlob

Get Object in Container

If getBlob is enabled, then the file created in the container will be get and returned as body, if not only the event will be returned as body.

boolean

false

serviceBusReceiveMode

Servicebus Receive Mode

Sets the receive mode for the receiver.

Enum values:

* RECEIVE_AND_DELETE * PEEK_LOCK

string

RECEIVE_AND_DELETE

subscriptionName

Subscription Name

Sets the name of the subscription in the topic to listen to. This parameter is mandatory in case of topic.

string

Dependencies

At runtime, the azure-storage-blob-cdc-source Kamelet relies upon the presence of the following dependencies:

  • camel:azure-servicebus

  • camel:azure-storage-blob

  • camel:kamelet

  • camel:core

  • camel:jsonpath

  • camel:jackson

Camel JBang usage

Prerequisites

  • You’ve installed JBang.

  • You have executed the following command:

jbang app install camel@apache/camel

Supposing you have a file named route.yaml with this content:

- route:
    from:
      uri: "kamelet:timer-source"
      parameters:
        period: 10000
        message: 'test'
      steps:
        - to:
            uri: "kamelet:log-sink"

You can now run it directly through the following command

camel run route.yaml

Camel K Environment Usage

This section describes how you can use the azure-storage-blob-cdc-source.

Knative source

You can use the azure-storage-blob-cdc-source Kamelet as a Knative source by binding it to a Knative object.

azure-storage-blob-cdc-source-pipe.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: azure-storage-blob-cdc-source-pipe
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: azure-storage-blob-cdc-source
    properties:
      accessKey: The Access Key
      accountName: The Account Name
      connectionString: The Connection String
      containerName: The Container Name
      topicOrQueueName: The Topic Or Queue Name
  sink:
    ref:
      kind: Channel
      apiVersion: messaging.knative.dev/v1
      name: mychannel

Prerequisite

You have Camel K installed on the cluster.

Procedure for using the cluster CLI

  1. Save the azure-storage-blob-cdc-source-pipe.yaml file to your local drive, and then edit it as needed for your configuration.

  2. Run the source by using the following command:

    kubectl apply -f azure-storage-blob-cdc-source-pipe.yaml

Procedure for using the Kamel CLI

Configure and run the source by using the following command:

kamel bind channel:mychannel -p "source.accessKey=The Access Key" -p "source.accountName=The Account Name" -p "source.connectionString=The Connection String" -p "source.containerName=The Container Name" -p "source.topicOrQueueName=The Topic Or Queue Name" azure-storage-blob-cdc-source

This command creates the Kamelet Pipe in the current namespace on the cluster.

Kafka source

You can use the azure-storage-blob-cdc-source Kamelet as a Kafka source by binding it to a Kafka topic.

azure-storage-blob-cdc-source-pipe.yaml
apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: azure-storage-blob-cdc-source-pipe
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: azure-storage-blob-cdc-source
    properties:
      accessKey: The Access Key
      accountName: The Account Name
      connectionString: The Connection String
      containerName: The Container Name
      topicOrQueueName: The Topic Or Queue Name
  sink:
    ref:
      kind: KafkaTopic
      apiVersion: kafka.strimzi.io/v1beta1
      name: my-topic

Prerequisites

  • You’ve installed Strimzi.

  • You’ve created a topic named my-topic in the current namespace.

  • You have Camel K installed on the cluster.

Procedure for using the cluster CLI

  1. Save the azure-storage-blob-cdc-source-pipe.yaml file to your local drive, and then edit it as needed for your configuration.

  2. Run the source by using the following command:

    kubectl apply -f azure-storage-blob-cdc-source-pipe.yaml

Procedure for using the Kamel CLI

Configure and run the source by using the following command:

kamel bind kafka.strimzi.io/v1beta1:KafkaTopic:my-topic -p "source.accessKey=The Access Key" -p "source.accountName=The Account Name" -p "source.connectionString=The Connection String" -p "source.containerName=The Container Name" -p "source.topicOrQueueName=The Topic Or Queue Name" azure-storage-blob-cdc-source

This command creates the Kamelet Pipe in the current namespace on the cluster.