Skip to content

Commit

Permalink
Added Infinispan Sink Kamelet
Browse files Browse the repository at this point in the history
  • Loading branch information
oscerd committed Nov 25, 2021
1 parent 89bac39 commit a3c9e39
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 31 deletions.
40 changes: 20 additions & 20 deletions docs/modules/ROOT/pages/infinispan-sink.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ At runtime, the `infinispan-sink` Kamelet relies upon the presence of the follow

This section describes how you can use the `infinispan-sink`.

=== Knative Source
=== Knative Sink

You can use the `infinispan-sink` Kamelet as a Knative source by binding it to a Knative object.
You can use the `infinispan-sink` Kamelet as a Knative sink by binding it to a Knative object.

.infinispan-sink-binding.yaml
[source,yaml]
Expand All @@ -58,6 +58,11 @@ metadata:
name: infinispan-sink-binding
spec:
source:
ref:
kind: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
Expand All @@ -67,11 +72,6 @@ spec:
hosts: "The Hosts"
password: "The Password"
username: "The Username"
sink:
ref:
kind: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
----

Expand All @@ -83,7 +83,7 @@ You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K

. 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:
. Run the sink by using the following command:
+
[source,shell]
----
Expand All @@ -92,18 +92,18 @@ kubectl apply -f infinispan-sink-binding.yaml

==== *Procedure for using the Kamel CLI*

Configure and run the source by using the following command:
Configure and run the sink 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
kamel bind channel:mychannel infinispan-sink -p "sink.cacheName=The Cache Name" -p "sink.hosts=The Hosts" -p "sink.password=The Password" -p "sink.username=The Username"
----

This command creates the KameletBinding in the current namespace on the cluster.

=== Kafka Source
=== Kafka Sink

You can use the `infinispan-sink` Kamelet as a Kafka source by binding it to a Kafka topic.
You can use the `infinispan-sink` Kamelet as a Kafka sink by binding it to a Kafka topic.

.infinispan-sink-binding.yaml
[source,yaml]
Expand All @@ -114,6 +114,11 @@ metadata:
name: infinispan-sink-binding
spec:
source:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
Expand All @@ -123,11 +128,6 @@ spec:
hosts: "The Hosts"
password: "The Password"
username: "The Username"
sink:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
----

Expand All @@ -141,7 +141,7 @@ spec:

. 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:
. Run the sink by using the following command:
+
[source,shell]
----
Expand All @@ -150,11 +150,11 @@ kubectl apply -f infinispan-sink-binding.yaml

==== *Procedure for using the Kamel CLI*

Configure and run the source by using the following command:
Configure and run the sink 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
kamel bind kafka.strimzi.io/v1beta1:KafkaTopic:my-topic infinispan-sink -p "sink.cacheName=The Cache Name" -p "sink.hosts=The Hosts" -p "sink.password=The Password" -p "sink.username=The Username"
----

This command creates the KameletBinding in the current namespace on the cluster.
Expand Down
10 changes: 5 additions & 5 deletions templates/bindings/camel-k/infinispan-sink-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ metadata:
name: infinispan-sink-binding
spec:
source:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
Expand All @@ -13,9 +18,4 @@ spec:
hosts: "The Hosts"
password: "The Password"
username: "The Username"
sink:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic

15 changes: 9 additions & 6 deletions templates/bindings/core/infinispan-sink-binding.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
- route:
from:
uri: "kamelet:infinispan-sink"
uri: "kamelet:timer-source"
parameters:
cacheName: "The Cache Name"
hosts: "The Hosts"
password: "The Password"
username: "The Username"
period: 1000
message: "Hello Camel JBang"
steps:
- to:
uri: "log:info"
uri: "kamelet:infinispan-sink"
parameters:
cacheName: "The Cache Name"
hosts: "The Hosts"
password: "The Password"
username: "The Username"

0 comments on commit a3c9e39

Please sign in to comment.