You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/10/10 10:11:12 UTC

[camel-kamelets-examples] branch main updated: Add camel-k bind example

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

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new 32beaca  Add camel-k bind example
32beaca is described below

commit 32beaca1f1e7398ac292e7b66cd2dcc07afaba89
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Oct 10 12:11:03 2023 +0200

    Add camel-k bind example
---
 jbang/camelk-bind/README.adoc  | 83 ++++++++++++++++++++++++++++++++++++++++++
 jbang/camelk-bind/my-bind.yaml | 20 ++++++++++
 2 files changed, 103 insertions(+)

diff --git a/jbang/camelk-bind/README.adoc b/jbang/camelk-bind/README.adoc
new file mode 100644
index 0000000..82611ee
--- /dev/null
+++ b/jbang/camelk-bind/README.adoc
@@ -0,0 +1,83 @@
+== Camel K binding
+
+This example is a Camel K binding CRD (named pipe in the spec)
+that binds a source to a sink.
+
+=== Install JBang
+
+First install JBang according to https://www.jbang.dev
+
+When JBang is installed then you should be able to run from a shell:
+
+[source,sh]
+----
+$ jbang --version
+----
+
+This will output the version of JBang.
+
+To run this example you can either install Camel on JBang via:
+
+[source,sh]
+----
+$ jbang app install camel@apache/camel
+----
+
+Which allows to run CamelJBang with `camel` as shown below.
+
+=== How to run
+
+Then you can run this example using:
+
+[source,sh]
+----
+$ camel run my-bind.yaml
+----
+
+Or run with JBang using the longer command line (without installing camel as app in JBang):
+
+[source,sh]
+----
+$ jbang camel@apache/camel run my-bind.yaml
+----
+
+=== Run directly from github
+
+The example can also be run directly by referring to the github URL as shown:
+
+[source,sh]
+----
+$ jbang camel@apache/camel run https://github.com/apache/camel-kamelets-examples/tree/main/jbang/camelk-bind
+----
+
+=== Live reload
+
+You can run the example in dev mode which allows you to edit the example,
+and hot-reload when the file is saved.
+
+[source,sh]
+----
+$ camel run my-bind.yaml --dev
+----
+
+=== Developer Web Console
+
+You can enable the developer console via `--console` flag as show:
+
+[source,sh]
+----
+$ camel run my-bind.yaml --console
+----
+
+Then you can browse: http://localhost:8080/q/dev to introspect the running Camel applicaton.
+
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/community/support/[let us know].
+
+We also love contributors, so
+https://camel.apache.org/community/contributing/[get involved] :-)
+
+The Camel riders!
diff --git a/jbang/camelk-bind/my-bind.yaml b/jbang/camelk-bind/my-bind.yaml
new file mode 100644
index 0000000..1de86e0
--- /dev/null
+++ b/jbang/camelk-bind/my-bind.yaml
@@ -0,0 +1,20 @@
+apiVersion: camel.apache.org/v1
+kind: Pipe
+metadata:
+  name: my-bind
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1
+      name: timer-source
+    properties:
+      message: "hello world"
+
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1
+      name: log-sink
+    #properties:
+      #key: "value"