Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure storage queue sink #143

Merged
merged 6 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
61 changes: 61 additions & 0 deletions azure-storage-queue-sink.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: azure-storage-queue-sink
annotations:
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgOTEgODEiIGZpbGw9IiNmZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjx1c2UgeGxpbms6aHJlZj0iI0EiIHg9Ii41IiB5PSIuNSIvPjxzeW1ib2wgaWQ9IkEiIG92ZXJmbG93PSJ2aXNpYmxlIj48cGF0aCBkPSJNNzAuMDUzIDM0LjYzNEg1MC41OGw5LjczNiA3LjgwNXptLTM5LjQyIDEwLjQ4OGMtLjIzOCAwLS40NzUgMC0uNzEzLS4yNDRsLTkuMDI0LTcuMzE3djExLjk1MWgyMC42NlYzNy4zMTdsLTkuNzM2IDcuNTYxYy0uNDc1LjI0NC0uOTUuMjQ0LTEuMTg3LjI0NHptMjkuNjgzIDBjLS4yMzggMC0uNzEzIDAtLjcxMy0uMjQ0bC05LjI2MS03LjMxN3YxMS45NTFoMjAuNjZWMzcuMzE3bC05L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3ltYm9sPjwvc3ZnPg=="
camel.apache.org/provider: "Apache Software Foundation"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "Azure Storage Queue Sink"
description: |-
Send Messages to Azure Storage queues.

The Kamelet is able to understand the following headers to be set:

- `expiration` / `ce-expiration`: as the time to live of the message in the queue.
oscerd marked this conversation as resolved.
Show resolved Hide resolved

If the header won't be set the default of 7 days will be used.

The format should be in this form: PnDTnHnMn.nS., e.g: PT20.345S — parses as 20.345 seconds, P2D — parses as 2 days.
required:
- accountName
- queueName
- accessKey
properties:
accountName:
title: Account Name
description: The Azure Storage Queue account name.
type: string
queueName:
title: Queue Name
description: The Azure Storage Queue container name.
type: string
accessKey:
title: Access Key
description: The Azure Storage Queue access Key.
type: string
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
flow:
from:
uri: "kamelet:source"
steps:
- choice:
when:
- simple: "${header[expiration]}"
steps:
- set-header:
name: CamelAzureStorageQueueTimeToLive
simple: "${header[expiration]}"
- simple: "${header[ce-expiration]}"
steps:
- set-header:
name: CamelAzureStorageQueueTimeToLive
simple: "${header[ce-expiration]}"
- to:
uri: "azure-storage-queue://{{accountName}}/{{queueName}}"
parameters:
accessKey: "{{accessKey}}"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* xref:ROOT:aws-sqs-source.adoc[image:kamelets/aws-sqs-source.svg[] AWS SQS Source]
* xref:ROOT:azure-storage-blob-sink.adoc[image:kamelets/azure-storage-blob-sink.svg[] Azure Storage Blob Sink]
* xref:ROOT:azure-storage-blob-source.adoc[image:kamelets/azure-storage-blob-source.svg[] Azure Storage Blob Source]
* xref:ROOT:azure-storage-queue-sink.adoc[image:kamelets/azure-storage-queue-sink.svg[] Azure Storage Queue Sink]
* xref:ROOT:bitcoin-source.adoc[image:kamelets/bitcoin-source.svg[] Bitcoin Source]
* xref:ROOT:dropbox-sink.adoc[image:kamelets/dropbox-sink.svg[] Dropbox Sink]
* xref:ROOT:dropbox-source.adoc[image:kamelets/dropbox-source.svg[] Dropbox Source]
Expand Down
72 changes: 72 additions & 0 deletions docs/modules/ROOT/pages/azure-storage-queue-sink.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
= image:kamelets/azure-storage-queue-sink.svg[] Azure Storage Queue Sink

*Provided by: "Apache Software Foundation"*

Send Messages to Azure Storage queues.

The Kamelet is able to understand the following headers to be set:

- `expiration` / `ce-expiration`: as the time to live of the message in the queue.

If the header won't be set the default of 7 days will be used.

The format should be in this form: PnDTnHnMn.nS., e.g: PT20.345S — parses as 20.345 seconds, P2D — parses as 2 days.

== Configuration Options

The following table summarizes the configuration options available for the `azure-storage-queue-sink` Kamelet:
[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
|===
| Property| Name| Description| Type| Default| Example
| *accessKey {empty}* *| Access Key| The Azure Storage Queue access Key.| string| |
| *accountName {empty}* *| Account Name| The Azure Storage Queue account name.| string| |
| *queueName {empty}* *| Queue Name| The Azure Storage Queue container name.| string| |
|===

NOTE: Fields marked with ({empty}*) are mandatory.

== Usage

This section summarizes how the `azure-storage-queue-sink` can be used in various contexts.

=== Knative Sink

The `azure-storage-queue-sink` Kamelet can be used as Knative sink by binding it to a Knative object.

.azure-storage-queue-sink-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: azure-storage-queue-sink-binding
spec:
source:
ref:
kind: InMemoryChannel
apiVersion: messaging.knative.dev/v1
name: mychannel
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: azure-storage-queue-sink
properties:
accessKey: "The Access Key"
accountName: "The Account Name"
queueName: "The Queue Name"

----

Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.

Save the `azure-storage-queue-sink-binding.yaml` file into your hard drive, then configure it according to your needs.

You can run the sink using the following command:

[source,shell]
----
kubectl apply -f azure-storage-queue-sink-binding.yaml
----
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT