You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/07/27 12:43:40 UTC

[camel-kamelets] 04/08: Added Azure CosmosDB Source Kamelet

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch cosmosdb-source
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 7a5d4317ff06ab254e244afea1051485370d89e5
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 27 14:39:03 2021 +0200

    Added Azure CosmosDB Source Kamelet
---
 .../images/kamelets/azure-cosmosdb-source.svg      |   1 +
 docs/modules/ROOT/pages/azure-cosmosdb-source.adoc | 137 +++++++++++++++++++++
 2 files changed, 138 insertions(+)

diff --git a/docs/modules/ROOT/assets/images/kamelets/azure-cosmosdb-source.svg b/docs/modules/ROOT/assets/images/kamelets/azure-cosmosdb-source.svg
new file mode 100644
index 0000000..5e93f52
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/azure-cosmosdb-source.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18"><defs><radialGradient id="a" cx="-105.006" cy="-10.409" r="5.954" gradientTransform="matrix(1.036 0 0 1.027 117.739 19.644)" gradientUnits="userSpaceOnUse"><stop offset=".183" stop-color="#5ea0ef"/><stop offset="1" stop-color="#0078d4"/></radialGradient><clipPath id="b"><path d="M14.969 7.53a6.137 6.137 0 11-7.395-4.543 6.137 6.137 0 017.395 4.543z" fill="none"/></clipPath></defs><path d="M2.954 5.266a.175.175 0 01-.176-.176A2.0 [...]
\ No newline at end of file
diff --git a/docs/modules/ROOT/pages/azure-cosmosdb-source.adoc b/docs/modules/ROOT/pages/azure-cosmosdb-source.adoc
new file mode 100644
index 0000000..8c2cc31
--- /dev/null
+++ b/docs/modules/ROOT/pages/azure-cosmosdb-source.adoc
@@ -0,0 +1,137 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+= image:kamelets/azure-cosmosdb-source.svg[] Azure CosmosDB Source
+
+*Provided by: "Apache Software Foundation"*
+
+*Support Level for this Kamelet is: "Preview"*
+
+Consume Changes from a CosmosDB instance
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `azure-cosmosdb-source` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *accountKey {empty}* *| Account Key| The Azure Cosmos account Key.| string| | 
+| *containerName {empty}* *| Container Name| The Azure Cosmos container name.| string| | 
+| *databaseEndpoint {empty}* *| Database Endpoint| Sets the Azure Cosmos database endpoint the component will connect to.| string| | 
+| *databaseName {empty}* *| Database Name| The Azure Cosmos database name.| string| | 
+| createLeaseContainerIfNotExists| Autocreate Lease Container| Sets if the component should create Cosmos lease container for the consumer automatically in case it doesn’t exist in Cosmos database.| boolean| `false`| 
+| createLeaseDatabaseIfNotExists| Autocreate Lease Database| Sets if the component should create Cosmos lease database for the consumer automatically in case it doesn’t exist in Cosmos account.| boolean| `false`| 
+| leaseContainerName| Lease Container Name| Sets the lease database where the leaseContainerName will be stored.| string| | 
+| leaseDatabaseName| Lease Database Name| Sets the lease container which acts as a state storage and coordinates processing the change feed across multiple workers.| string| | 
+|===
+
+NOTE: Fields marked with ({empty}*) are mandatory.
+
+== Usage
+
+This section summarizes how the `azure-cosmosdb-source` can be used in various contexts.
+
+=== Knative Source
+
+The `azure-cosmosdb-source` Kamelet can be used as Knative source by binding it to a Knative object.
+
+.azure-cosmosdb-source-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: azure-cosmosdb-source-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: azure-cosmosdb-source
+    properties:
+      accountKey: "The Account Key"
+      containerName: "The Container Name"
+      databaseEndpoint: "The Database Endpoint"
+      databaseName: "The Database Name"
+  sink:
+    ref:
+      kind: InMemoryChannel
+      apiVersion: messaging.knative.dev/v1
+      name: mychannel
+
+----
+
+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-cosmosdb-source-binding.yaml` file into your hard drive, then configure it according to your needs.
+
+You can run the source using the following command:
+
+[source,shell]
+----
+kubectl apply -f azure-cosmosdb-source-binding.yaml
+----
+
+==== *Binding to Knative using the Kamel CLI:*
+
+The procedure described above can be simplified into a single execution of the `kamel bind` command:
+
+[source,shell]
+----
+kamel bind azure-cosmosdb-source -p "source.accountKey=The Account Key" -p "source.containerName=The Container Name" -p "source.databaseEndpoint=The Database Endpoint" -p "source.databaseName=The Database Name" channel/mychannel
+----
+
+This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.
+
+=== Kafka Source
+
+The `azure-cosmosdb-source` Kamelet can be used as Kafka source by binding it to a Kafka topic.
+
+.azure-cosmosdb-source-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: azure-cosmosdb-source-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: azure-cosmosdb-source
+    properties:
+      accountKey: "The Account Key"
+      containerName: "The Container Name"
+      databaseEndpoint: "The Database Endpoint"
+      databaseName: "The Database Name"
+  sink:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
+
+----
+
+Ensure that you've installed https://strimzi.io/[Strimzi] and created a topic named `my-topic` in the current namespace.
+Make also sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.
+
+Save the `azure-cosmosdb-source-binding.yaml` file into your hard drive, then configure it according to your needs.
+
+You can run the source using the following command:
+
+[source,shell]
+----
+kubectl apply -f azure-cosmosdb-source-binding.yaml
+----
+
+==== *Binding to Kafka using the Kamel CLI:*
+
+The procedure described above can be simplified into a single execution of the `kamel bind` command:
+
+[source,shell]
+----
+kamel bind azure-cosmosdb-source -p "source.accountKey=The Account Key" -p "source.containerName=The Container Name" -p "source.databaseEndpoint=The Database Endpoint" -p "source.databaseName=The Database Name" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
+----
+
+This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.
+
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT