blob: a2a21f792024eb92fee19ada2af3c0e89de6be68 [file] [log] [blame]
== Camel Example JBang
This example shows how to run Camel using JBang.
=== 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 Hey.java
----
Or run with JBang using the longer command line (without installing camel as app in JBang):
[source,sh]
----
$ jbang camel@apache/camel run Hey.java
----
=== 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-examples/tree/main/examples/jbang
----
You can even try other examples such as the polyglot example from Camel K:
[source,sh]
----
$ jbang camel@apache/camel run https://github.com/apache/camel-k/tree/main/examples/polyglot
----
Or the Kotlin route(s) (you can use wildcards):
[source,sh]
----
$ jbang camel@apache/camel run https://github.com/apache/camel-k/tree/main/examples/languages/*.kts
----
=== Live reload
You can run the example with reload enabled which allows you to edit the example,
and hot-reload when the file is saved.
[source,sh]
----
$ camel run Hey.java --reload
----
=== Developer Web Console
You can enable the developer console via `--console` flag as show:
[source,sh]
----
$ camel run Hey.java --console
----
Then you can browse: http://localhost:8080/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!