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

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

commit e331bba8c912f00e4d820cdd587fa1251c9a4add
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Wed Sep 8 15:32:45 2021 +0200

    Added Google Pubsub Sink Kamelet
---
 .../assets/images/kamelets/google-pubsub-sink.svg  |   1 +
 docs/modules/ROOT/pages/google-pubsub-sink.adoc    | 131 +++++++++++++++++++++
 2 files changed, 132 insertions(+)

diff --git a/docs/modules/ROOT/assets/images/kamelets/google-pubsub-sink.svg 
b/docs/modules/ROOT/assets/images/kamelets/google-pubsub-sink.svg
new file mode 100644
index 0000000..449dd6e
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/google-pubsub-sink.svg
@@ -0,0 +1 @@
+<svg height="2500" viewBox="-1.63323543 7.03260933 131.26574682 114.43939067" 
width="2500" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink";><linearGradient id="a" 
gradientUnits="userSpaceOnUse" x1="64" x2="64" y1="7.034" y2="120.789"><stop 
offset="0" stop-color="#4387fd"/><stop offset="1" 
stop-color="#4683ea"/></linearGradient><path d="m27.79 
115.217-26.25-45.468a11.499 11.499 0 0 1 0-11.499l26.25-45.467a11.5 11.5 0 0 1 
9.96-5.75h52.5a11.5 11.5 0 0 1 9.959 5. [...]
\ No newline at end of file
diff --git a/docs/modules/ROOT/pages/google-pubsub-sink.adoc 
b/docs/modules/ROOT/pages/google-pubsub-sink.adoc
new file mode 100644
index 0000000..24a2ef1
--- /dev/null
+++ b/docs/modules/ROOT/pages/google-pubsub-sink.adoc
@@ -0,0 +1,131 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+= image:kamelets/google-pubsub-sink.svg[] Google Pubsub Sink
+
+*Provided by: "Apache Software Foundation"*
+
+*Support Level for this Kamelet is: "Preview"*
+
+Send messages to Google Pubsub.
+
+The serviceAccountKey property needs to be encoded in base64, so when you pass 
it as parameter, don't forget to encode it.
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the 
`google-pubsub-sink` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *destinationName {empty}* *| Destination Name| The Destination Name| string| 
| 
+| *projectId {empty}* *| Project Id| The Google Cloud PubSub Project Id| 
string| | 
+| *serviceAccountKey {empty}* *| Service Account Key| The Service account key 
that can be used as credentials for the PubSub publisher/subscriber| binary| | 
+|===
+
+NOTE: Fields marked with ({empty}*) are mandatory.
+
+== Usage
+
+This section summarizes how the `google-pubsub-sink` can be used in various 
contexts.
+
+=== Knative Sink
+
+The `google-pubsub-sink` Kamelet can be used as Knative sink by binding it to 
a Knative object.
+
+.google-pubsub-sink-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: google-pubsub-sink-binding
+spec:
+  source:
+    ref:
+      kind: InMemoryChannel
+      apiVersion: messaging.knative.dev/v1
+      name: mychannel
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: google-pubsub-sink
+    properties:
+      destinationName: "The Destination Name"
+      projectId: "The Project Id"
+      serviceAccountKey: "The Service Account Key"
+  
+----
+Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K 
installed] into the Kubernetes cluster you're connected to.
+
+Save the `google-pubsub-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 google-pubsub-sink-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 channel/mychannel google-pubsub-sink -p "sink.destinationName=The 
Destination Name" -p "sink.projectId=The Project Id" -p 
"sink.serviceAccountKey=The Service Account Key"
+----
+
+This will create the KameletBinding under the hood and apply it to the current 
namespace in the cluster.
+
+=== Kafka Sink
+
+The `google-pubsub-sink` Kamelet can be used as Kafka sink by binding it to a 
Kafka topic.
+
+.google-pubsub-sink-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: google-pubsub-sink-binding
+spec:
+  source:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: google-pubsub-sink
+    properties:
+      destinationName: "The Destination Name"
+      projectId: "The Project Id"
+      serviceAccountKey: "The Service Account Key"
+  
+----
+
+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 `google-pubsub-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 google-pubsub-sink-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 kafka.strimzi.io/v1beta1:KafkaTopic:my-topic google-pubsub-sink -p 
"sink.destinationName=The Destination Name" -p "sink.projectId=The Project Id" 
-p "sink.serviceAccountKey=The Service Account Key"
+----
+
+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

Reply via email to