Azure Storage Queue Sink
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Stable"
Adds each message to a queue in Azure Queue Storage, as the text of a queue message.
Use it to hand work to another application or worker that reads the queue, such as orders to process or jobs to run. For a message broker with topics and dead-letter queues, use azure-servicebus-sink.
Input: the body is the text of the queue message: text or bytes. A Map is sent as its text form, so turn it into JSON text first, for example with json-serialize-action. The optional expiration header (or ce-expiration) sets how long the message stays in the queue, as an ISO-8601 duration such as PT1H (one hour) or P2D (two days); without it, the message expires after 7 days.
Output: the body afterwards is true, and headers such as CamelAzureStorageQueueMessageId and CamelAzureStorageQueueExpirationTime describe the message sent.
Good to know: the queue must exist: a missing queue fails the message. An expiration that is a plain number, such as 600, fails the message.
Configuration Options
The following table summarizes the configuration options available for the azure-storage-queue-sink Kamelet:
| Property | Name | Description | Type | Default | Example |
|---|---|---|---|---|---|
Access Key | Required An access key of the storage account, from the Azure portal: the storage account, then Security + networking, then Access keys. Used when | string | |||
Account Name | Required The name of the storage account, as shown in the Azure portal under Storage accounts. It is the first part of the address of the account, | string | mystorageaccount | ||
Queue Name | Required The name of the queue in the storage account to send the messages to. | string | orders | ||
Credential Type | How to log in to the storage account. Enum values: * SHARED_ACCOUNT_KEY * SHARED_KEY_CREDENTIAL * AZURE_IDENTITY | string | SHARED_ACCOUNT_KEY |
Dependencies
At runtime, the azure-storage-queue-sink Kamelet relies upon the presence of the following dependencies:
-
camel:azure-storage-queue
-
camel:kamelet
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:azure-storage-queue-sink" You can now run it directly through the following command
camel run route.yaml Azure Storage Queue Sink Kamelet Description
Authentication methods
In this Kamelet, you can use these Azure authentication methods:
-
Azure Identity mechanism:
AZURE_IDENTITY -
Plain Shared Account Key:
SHARED_ACCOUNT_KEY -
Shared Key Credentials:
SHARED_KEY_CREDENTIAL
The default is SHARED_ACCOUNT_KEY.
The order of evaluation for AZURE_IDENTITY is the following:
-
Enviroment
-
Workload Identity
-
Managed Identity
-
Azure Developer CLI
-
IntelliJ
-
Azure CLI
-
Azure Powershell
For more information, see the Azure Identity documentation
Optional Headers
In the header, you can set the expiration / ce-expiration property to determine how long an event remains in the Azure Storage queue. Use PnDTnHnMn.nS. format. For example, PT20.345S parses as 20.345 seconds and P2D parses as 2 days. A plain number, such as 600, fails the message. If you do not set the property in the header, the message expires after 7 days.