This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch infinispan-sink in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit fa5a4b67c8bdefea16897de14a712ffd0086fe0e Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Thu Nov 25 15:00:16 2021 +0100 Added Infinispan Sink Kamelet --- .../assets/images/kamelets/infinispan-sink.svg | 1 + docs/modules/ROOT/nav.adoc | 1 + docs/modules/ROOT/pages/infinispan-sink.adoc | 166 +++++++++++++++++++++ .../bindings/camel-k/infinispan-sink-binding.yaml | 21 +++ .../bindings/core/infinispan-sink-binding.yaml | 12 ++ 5 files changed, 201 insertions(+) diff --git a/docs/modules/ROOT/assets/images/kamelets/infinispan-sink.svg b/docs/modules/ROOT/assets/images/kamelets/infinispan-sink.svg new file mode 100644 index 0000000..8ebac47 --- /dev/null +++ b/docs/modules/ROOT/assets/images/kamelets/infinispan-sink.svg @@ -0,0 +1 @@ +<svg id="artwork" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 215"><defs><style>.cls-1{fill:#0b2545;}.cls-2{fill:#599fc6;}</style></defs><rect class="cls-1" x="297.24" y="1.98" width="11.9" height="158.12"/><path class="cls-1" d="M395.25,64.88c-7.81-9.45-18.9-14.24-33-14.24-13.77,0-24.73,4.75-32.64,14.11V52.39H318.27v107.7h11.37V94.18c0-10,3-18.08,8.82-24.05s13.87-9,23.82-9,18.1,3.46,24.1,10.28c5.74,6.51,8.65,15,8.65,25.18v63.49h11.14V99.43C406.17,85.15,402.49,73.52,395.25,64.88 [...] \ No newline at end of file diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 64d1840..4e3bd0c 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -63,6 +63,7 @@ * xref:ROOT:http-secured-source.adoc[image:kamelets/http-secured-source.svg[] HTTP Secured Source] * xref:ROOT:http-sink.adoc[image:kamelets/http-sink.svg[] HTTP Sink] * xref:ROOT:http-source.adoc[image:kamelets/http-source.svg[] HTTP Source] +* xref:ROOT:infinispan-sink.adoc[image:kamelets/infinispan-sink.svg[] Infinispan Sink] * xref:ROOT:infinispan-source.adoc[image:kamelets/infinispan-source.svg[] Infinispan Source] * xref:ROOT:insert-field-action.adoc[image:kamelets/insert-field-action.svg[] Insert Field Action] * xref:ROOT:insert-header-action.adoc[image:kamelets/insert-header-action.svg[] Insert Header Action] diff --git a/docs/modules/ROOT/pages/infinispan-sink.adoc b/docs/modules/ROOT/pages/infinispan-sink.adoc new file mode 100644 index 0000000..e471a21 --- /dev/null +++ b/docs/modules/ROOT/pages/infinispan-sink.adoc @@ -0,0 +1,166 @@ +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT + += image:kamelets/infinispan-sink.svg[] Infinispan Sink + +*Provided by: "Apache Software Foundation"* + +*Support Level for this Kamelet is: "Preview"* + +Write object to an Infinispan cache. + +The Kamelet expects the following headers to be set: + +- `key` / `ce-key`: as the key to use when put an object in the Infinispan cache. + +If the header won't be set the exchange ID will be used as key. + +== Configuration Options + +The following table summarizes the configuration options available for the `infinispan-sink` Kamelet: +[width="100%",cols="2,^2,3,^2,^2,^3",options="header"] +|=== +| Property| Name| Description| Type| Default| Example +| *cacheName {empty}* *| Cache Name| The name of the Infinispan cache to use| String| | +| *hosts {empty}* *| Hosts| Specifies the host of the cache on Infinispan instance| String| | +| *password {empty}* *| Password| Password to connect to Infinispan.| string| | +| *username {empty}* *| Username| Username to connect to Infinispan.| string| | +| saslMechanism| SASL Mechanism| The SASL Mechanism to use| String| `"DIGEST-MD5"`| +| secure| Secure| If the Infinispan instance is secured or not| boolean| `true`| +| securityRealm| Security Realm| Define the security realm to access the infinispan instance| string| `"default"`| +| securityServerName| Security Server name| Define the security server name to access the infinispan instance| string| `"infinispan"`| +|=== + +NOTE: Fields marked with an asterisk ({empty}*) are mandatory. + + +== Dependencies + +At runtime, the `infinispan-sink` Kamelet relies upon the presence of the following dependencies: + +- camel:kamelet +- camel:core +- camel:infinispan + +== Usage + +This section describes how you can use the `infinispan-sink`. + +=== Knative Source + +You can use the `infinispan-sink` Kamelet as a Knative source by binding it to a Knative object. + +.infinispan-sink-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: infinispan-sink-binding +spec: + source: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: infinispan-sink + properties: + cacheName: "The Cache Name" + hosts: "The Hosts" + password: "The Password" + username: "The Username" + sink: + ref: + kind: Channel + apiVersion: messaging.knative.dev/v1 + name: mychannel + +---- + +==== *Prerequisite* + +You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K installed] on the cluster. + +==== *Procedure for using the cluster CLI* + +. Save the `infinispan-sink-binding.yaml` file to your local drive, and then edit it as needed for your configuration. + +. Run the source by using the following command: ++ +[source,shell] +---- +kubectl apply -f infinispan-sink-binding.yaml +---- + +==== *Procedure for using the Kamel CLI* + +Configure and run the source by using the following command: + +[source,shell] +---- +kamel bind infinispan-sink -p "source.cacheName=The Cache Name" -p "source.hosts=The Hosts" -p "source.password=The Password" -p "source.username=The Username" channel:mychannel +---- + +This command creates the KameletBinding in the current namespace on the cluster. + +=== Kafka Source + +You can use the `infinispan-sink` Kamelet as a Kafka source by binding it to a Kafka topic. + +.infinispan-sink-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: infinispan-sink-binding +spec: + source: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: infinispan-sink + properties: + cacheName: "The Cache Name" + hosts: "The Hosts" + password: "The Password" + username: "The Username" + sink: + ref: + kind: KafkaTopic + apiVersion: kafka.strimzi.io/v1beta1 + name: my-topic + +---- + +==== *Prerequisites* + +* You've installed https://strimzi.io/[Strimzi]. +* You've created a topic named `my-topic` in the current namespace. +* You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K installed] on the cluster. + +==== *Procedure for using the cluster CLI* + +. Save the `infinispan-sink-binding.yaml` file to your local drive, and then edit it as needed for your configuration. + +. Run the source by using the following command: ++ +[source,shell] +---- +kubectl apply -f infinispan-sink-binding.yaml +---- + +==== *Procedure for using the Kamel CLI* + +Configure and run the source by using the following command: + +[source,shell] +---- +kamel bind infinispan-sink -p "source.cacheName=The Cache Name" -p "source.hosts=The Hosts" -p "source.password=The Password" -p "source.username=The Username" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic +---- + +This command creates the KameletBinding in the current namespace on the cluster. + +== Kamelet source file + +https://github.com/apache/camel-kamelets/blob/main/infinispan-sink.kamelet.yaml + +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT diff --git a/templates/bindings/camel-k/infinispan-sink-binding.yaml b/templates/bindings/camel-k/infinispan-sink-binding.yaml new file mode 100644 index 0000000..b949014 --- /dev/null +++ b/templates/bindings/camel-k/infinispan-sink-binding.yaml @@ -0,0 +1,21 @@ +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: infinispan-sink-binding +spec: + source: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: infinispan-sink + properties: + cacheName: "The Cache Name" + hosts: "The Hosts" + password: "The Password" + username: "The Username" + sink: + ref: + kind: KafkaTopic + apiVersion: kafka.strimzi.io/v1beta1 + name: my-topic + \ No newline at end of file diff --git a/templates/bindings/core/infinispan-sink-binding.yaml b/templates/bindings/core/infinispan-sink-binding.yaml new file mode 100644 index 0000000..939e1dd --- /dev/null +++ b/templates/bindings/core/infinispan-sink-binding.yaml @@ -0,0 +1,12 @@ +- route: + from: + uri: "kamelet:infinispan-sink" + parameters: + cacheName: "The Cache Name" + hosts: "The Hosts" + password: "The Password" + username: "The Username" + steps: + - to: + uri: "log:info" + \ No newline at end of file